• elasawy
    了解作者
  • C/C++
    开发工具
  • 47KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 0
    下载次数
  • 2019-07-05 05:48
    上传日期
Temp Sensor Code For AVR LM35
Temp_Sensor.rar
  • Temp_Sensor
  • Temp_Sensor
  • Debug
  • MicroControllerConfig.d
    2.4KB
  • Temp_Sensor.srec
    4KB
  • Temp_Sensor.hex
    4.1KB
  • Temp_Sensor.eep
    13B
  • LCD.o
    10.9KB
  • makedep.mk
    302B
  • Temp_Sensor.d
    2.4KB
  • Temp_Sensor.lss
    34.2KB
  • Makefile
    4KB
  • Temp_Sensor.elf
    13.3KB
  • LCD.d
    4.5KB
  • MicroControllerConfig.o
    6KB
  • Temp_Sensor.o
    6.8KB
  • ADC_ATmega32A.d
    2.4KB
  • ADC_ATmega32A.o
    6.2KB
  • Temp_Sensor.map
    36.2KB
  • ADC_ATmega32A.c
    1.2KB
  • Temp_Sensor.c
    547B
  • MicroControllerConifg.h
    3.9KB
  • Temp_Sensor.cproj
    5.6KB
  • STD_TYPES.h
    477B
  • MicroControllerConfig.c
    1.1KB
  • LCD.c
    8.2KB
  • MACROS.h
    783B
  • ADC_ATmega32A.h
    2.1KB
  • LCD.h
    5.3KB
  • Temp_Sensor.atsln
    904B
  • Temp_Sensor.atsuo
    14KB
内容介绍
/* * LCD.h * * Created: 12/13/2017 1:46:01 AM * Author: Hamdy * ******************************* internal Structure ************************** * * The LCD Contains Two 8-bit Registers ( Instruction Register for Storing Instructions ) (Data Register That Stores incoming Data). * Character Generator ROM (CGROM) ( Contains Predefined 5 * 8 (208 Character) dot or 5 * 10 (32 Char) dot character patterns. * Character Display RAM (DDRAM) (In the character generator RAM, the user can rewrite character patterns by program. For 5 * 8 dots.) * * ******************************* Operating Modes ***************************** * * (8-bit Mode) all eight bus lines (DB0 to DB7) are used. * (4-bit Mode) four bus lines (DB4 to DB7) are used for transfer to transfer data, the four high order bits of Data, are transferred before the four low order bits. * * ****************************** pinout Functions ***************************** * * * Control PINS * * RS Select 0 for Instruction Register , 1 for Data Register * RW Select 0 for Write , 1 For Read * E Starts Data read/Write ( Transaction From High To Low When Writing , Transaction From Low to High when Reading Data will be Available as long as the signal is High) * * * Data PINS * * DB4 to DB7 Four high order bidirectional pins. Used for data transfer and receive between the MPU and the LCD. * DB0 to DB3 Four Lower order bidirectional pins. Used for data transfer and receive between the MPU and the LCD. * DB7 Can Be Used As state indicator Flag * * * POWER PINS * * VSS Power Supply pin should be connected to GND * VDD Power Supply pin should be connected to VCC ( 3.3 ~ 9V) * VO Power Supply pin controls the LCD Contrast * A The Anode Terminal of the back LCD (Should be Driven High 3V) * K The cathode Terminal of The Back of the LCD ( GND ) * * ******************************** Function Description ************************** * * Busy Flag (BF) When the busy flag is 1 The LCD is Busy And Cannot Take Instructions You Can Check The Busy Flag When RS=0,RW=1 @ DB7 * * Operation Selection * RS R/W Operation * 0 0 IR write as an internal operation (display clear, etc.) * 0 1 Read busy flag (DB7) and address counter (DB0 to DB6) * 1 0 Write To LCD * 1 1 Read The Contents of The LCD * * ******************************** Instructions ************************************ * * Clear display Clears entire display and sets DDRAM address 0 in address counter. * Return home (1.52ms) Sets DDRAM address 0 in address counter. Also returns display from being shifted to original position DDRAM contents remain unchanged. * Entry mode set (37 us ) Sets cursor move direction and specifies display shift. * Display on/off control (37 us ) Controls LCD , Cursor , Blinking. * Cursor or display shift (37 us ) shifts LCD without changing it's Content. * Function set (37 us ) Sets interface data length (DL),number of display lines(N),and character font (F). * Read busy flag & address (0 us ) Reads busy flag (BF) * Set DDRAM address (37 us ) * Set CGRAM address (37 us ) * * * * */ #include "LCD.h" #include <stdlib.h> #include <avr/io.h rel='nofollow' onclick='return false;'> void LCD_init(void) { /* Set The Control Pins Direction to OUtput */ LCD_Control_reg_DIR |=(1<<E) | (1<<RW) | (1<<RS); #if eight_bitdata /* Set the Direction of the 8 Data pins to Output */ LCD_Data_Reg_DIR =0xFF; #else #ifdef Upper_Data_port /* Set The Direction of The Upper Pins to OP*/ LCD_Data_Reg_DIR |=(0xF0); #else /* Set The Direction of The LOWER Pins to OP*/ LCD_Data_Reg_DIR|=(0x0F); #endif Send_instruction(Return_Home); #endif Send_instruction(Data_Set); Send_instruction(Display_on); Send_instruction(Clear_display); } void Send_instruction(uint8 instruction) { /* RW, RS Should be 0 when Writing instructions to LCD */ CLEAR_BIT(LCD_Control_reg_OP,RS); CLEAR_BIT(LCD_Control_reg_OP,RW); /* Delay of Address Set 60ns minimum */ _delay_ms(1); /* Enable LCD E=1 */ SET_BIT(LCD_Control_reg_OP,E); /* delay for processing PW min 450ns */ _delay_ms(1); #if eight_bitdata LCD_Data_Reg_OP = instruction; /* Data set-up time delay Tdsw = 195 ns */ _delay_ms(1); /* disable LCD E=0 */ CLEAR_BIT(LCD_Control_reg_OP,E); /* Data Hold delay Th = 10ns */ _delay_ms(1); #else #ifdef Upper_Data_port /* clear the Prev Data */ LCD_Data_Reg_OP &=0x0F; LCD_Data_Reg_OP |= (instruction & 0xF0); #else /* Lower Port */ /* clear the Prev Data */ LCD_Data_Reg_OP &=0xF0; LCD_Data_Reg_OP |= ((instruction >> 4) & 0x0f); #endif /* Data set-up time delay Tdsw = 195 ns */ _delay_ms(1); /* disable LCD E=0 */ CLEAR_BIT(LCD_Control_reg_OP,E); /* Data Hold delay Th = 10ns */ _delay_ms(1); /* Enable LCD E=1 */ SET_BIT(LCD_Control_reg_OP,E); /* delay for processing PW min 450ns */ _delay_ms(1); #ifdef Upper_Data_port /* clear the Prev Data */ LCD_Data_Reg_OP &=0x0F; LCD_Data_Reg_OP |= ((instruction <<4) & 0xF0); #else /* Lower Port */ /* clear the Prev Data */ LCD_Data_Reg_OP &=0xF0; LCD_Data_Reg_OP |= ((instruction) & 0x0f); #endif /* Data set-up time delay Tdsw = 195 ns */ _delay_ms(1); /* disable LCD E=0 */ CLEAR_BIT(LCD_Control_reg_OP,E); /* Data Hold delay Th = 10ns */ _delay_ms(1); #endif } void LCD_DisplayChar(uint8 Data) { /* RW Should be 0 and RS should be 1 when Writing Data to LCD */ SET_BIT(LCD_Control_reg_OP,RS); CLEAR_BIT(LCD_Control_reg_OP,RW); /* Delay of Address Set 60ns minimum */ _delay_ms(1); /* Enable LCD E=1 */ SET_BIT(LCD_Control_reg_OP,E); /* delay for processing PW min 450ns */ _delay_ms(1); #if eight_bitdata LCD_Data_Reg_OP=Data; #else #ifdef Upper_Data_port /* clear the Prev Data */ LCD_Data_Reg_OP &=0x0F; /* Send MSB (4-bits )*/ LCD_Data_Reg_OP |= (Data & 0xF0); #else /* Lower Port */ /* clear the Prev Data */ LCD_Data_Reg_OP &=0xF0; /* Send MSB (4-bits )*/ LCD_Data_Reg_OP |= ((Data >> 4) & 0x0f); #endif /* Data set-up time delay Tdsw = 195 ns */ _delay_ms(1); /* disable LCD E=0 */ CLEAR_BIT(LCD_Control_reg_OP,E); /* Data Hold delay Th = 10ns */ _delay_ms(1); /* Enable LCD E=1 */ SET_BIT(LCD_Control_reg_OP,E); #ifdef Upper_Data_port /* clear the Prev Data */ LCD_Data_Reg_OP &=0x0F; LCD_Data_Reg_OP |= ((Data <<4) & 0xF0); /* delay for processing PW min 450ns */ _delay_ms(1); #else /* Lower Port */ /* clear the Prev Data */ LCD_Data_Reg_OP &=0xF0; LCD_Data_Reg_OP |= ((Data) & 0x0f); #endif #endif /* Data set-up time delay Tdsw = 195 ns */ _delay_ms(1); /* disable LCD E=0 */ CLEAR_BIT(LCD_Control_reg_OP,E); /* Data Hold delay Th = 10ns */ _delay_ms(1); } void LCD_Clear(void) { /* Clear Screen */ Send_instruction(Clear_display); } void LCD_DisplayString(char * ptr) { while(*ptr != '\0') { LCD_DisplayChar(*ptr); ptr++; } } void LCD_Select_RowCol(uint8 Row , uint8 col) { uint8 Address=0; switch(Row) { case 0: /* When Writing To LCD 1st Col The Base Address is 0x00 */ Address=col | LCD_1ST_BASE; break; case 1: /* When Writing To LCD 2nd Col The Base Address is 0x40 */ Address=col | LCD_2ND_BASE; break; case 2: /* When Writing To LCD 1st Col The Base Address is 0x10 */ Address = col | LCD_3RD_BASE
评论
    相关推荐
    • ATmega32.zip
      ATmega32单片机使用手册,包括引脚功能,代码例子,指令集合,勘误表等等
    • microgame:基于 AVR ATmega32U4 的主板玩一些自定义游戏
      它基于 Adafruit 的小型单色 128x64 像素 OLED 和运行在 8MHz 的 ATmega32U40 8 位微控制器。 所有硬件设计和游戏源代码都是从头开始编写的,如果你想构建自己的,你可以在这个存储库中找到所有文件。 您可以...
    • Smart-Home-Application-AVR:使用AVR Atmega32实现的智能家居应用
      使用AVR Atmega32和蓝牙模块HC-05实现的智能家居应用 特征: 使用用户名和密码登录的安全系统 语音控制系统 门控 带温度传感器的交流/风扇控制 带光传感器的灯光控制 音乐播放器 使用的外围设备: MCAL :(微控制...
    • AVR_Projects_ATmega32
      OTA-FOTA 无线固件 该存储库是曼苏拉工程学院(2020-2021)的FOTA毕业项目: 穆罕默德·哈菲兹·穆罕默德 阿卜杜勒曼·摩萨德·阿卜杜勒哈迪 乌萨玛·萨拉赫·希亚兹(Osama Salah Hijazi) ...
    • avr atmega16 的pcb图
      avr atmega16单片机的pcb最小系统图,宜于初学者
    • 单片机 AVR ATMEGA16
      单片机 适合初学者使用 很简单的程序 流水灯
    • avr atmega128 程序框架
      avr 单片机所有资源的配置,及程序基本框架,编译环境gcc avrstudio
    • avr atmega16 adc
      编写了avr单片机的adc模块可以直接调用 有仿真图
    • ATMEGA32-L.rar
      pdf for atmega32L avr controller
    • Atmega32A_IO.rar
      Atmega32 AVR IO Driver Using Greedy Method