EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home

Tuhin

  • Profile
  • Topics Started
  • Replies Created
  • Engagements

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • January 1, 2012 at 4:22 pm in reply to: Interfacing LM35 and avr controller with use of internal ADC of ATMEGA32 #6976
    Tuhin
    Participant

    I connected it on BreadBoard. I have a developement board from Extreme Electronics But in my Developement board JTAG is already disabled by fuse byte settings from the time of buying. So I tried this on BreadBoard and it worked.

    December 28, 2011 at 1:36 pm in reply to: Interfacing LM35 and avr controller with use of internal ADC of ATMEGA32 #6957
    Tuhin
    Participant
     hey, Dhruwank you just forget to diable jtag interface Port. I have modified your program a little and it is working on hardware and 

    wysiwyg_imageupload:3465:

    I have checked it. You have done a great job.
     
     
     
     
     
    #include <avr/io.h>
    #include<util/delay.h>
    #include<math.h>
    #include<stdlib.h>
    #define LCD_PRT PORTC
    #define LCD_PIN PINC
    #define LCD_DDR DDRC
    #define LCD_RS 0
    #define LCD_RW 1
    #define LCD_EN 2
    #define LS_NULL 0B00000000
     
     
    void delay_us(int d)
    {
    _delay_us(d);
    }
     
     
    void delay_ms(int d)
    {
    _delay_ms(d);
    }
     
    void lcdcommand(unsigned char cmnd)
    {
    LCD_PRT = (LCD_PRT & 0x0F)| (cmnd & 0xF0);
    LCD_PRT &=~(1<<LCD_RS);
    LCD_PRT &=~(1<<LCD_RW);
    LCD_PRT |=(1<<LCD_EN);
    delay_us(1);
    LCD_PRT &=~(1<<LCD_EN);
    delay_us(20);
    LCD_PRT = (LCD_PRT & 0x0F) | (cmnd<<4);
    LCD_PRT |= (1<<LCD_EN);
    delay_us(1);
    LCD_PRT &=~ (1<<LCD_EN);
    }
     
    void lcddata(unsigned char data)
    {
    LCD_PRT = (LCD_PRT & 0x0F) | (data & 0xF0);
    LCD_PRT |= (1<<LCD_RS);
    LCD_PRT &=~ (1<<LCD_RW);
    LCD_PRT |= (1<<LCD_EN);
    delay_us(1);
    LCD_PRT &=~ (1<<LCD_EN);
    delay_us(20);
    LCD_PRT = (LCD_PRT & 0x0F) | (data << 4);
    LCD_PRT |= (1<<LCD_EN);
    delay_us(1);
    LCD_PRT &=~ (1<<LCD_EN);
    }
     
     
    void LCD_init()
    {
    LCD_DDR = 0xFF;
    LCD_PRT &=~(1<<LCD_EN);
    delay_us(2000);
    lcdcommand(0x33);
    delay_us(100);
    lcdcommand(0x32);
    delay_us(100);
    lcdcommand(0x28);
    delay_us(100);
    lcdcommand(0x0E);
    delay_us(100);
    lcdcommand(0x01);
    delay_us(2000);
    lcdcommand(0x06);
    delay_us(100);
    }
     
    unsigned int adc_conv(void)
    {
    DDRA=0;
    ADCSRA=0x87;
    ADMUX=0xE0;
    ADCSRA|=(1<<ADSC);
    while((ADCSRA&(1<<ADIF))==0);
    return ADCH;
    }
     
    void LCD_gotoxy(unsigned char x, unsigned char y)
    {
    unsigned char firstcharadr[]={0x80, 0x85};
    lcdcommand(firstcharadr[y-1] + x – 1);
    delay_us(100);
    }
     
     
    void LCD_print(char * str)
    {
    unsigned char i=0;
    while(str!=0)
    {
    lcddata(str);
    i++;
    }
    }
     
     
     
     
    int main(void)
    {
    MCUCSR|= (1<<JTD);      //disaleb JTAG
    MCUCSR|= (1<<JTD); 
     
    unsigned char val,t;
    LCD_init(LS_NULL);
    LCD_gotoxy(1,1);
    LCD_print(“Temperature “);
    LCD_gotoxy(10,2);
    LCD_print(“*c”);
    while(1)
    {
     
    LCD_gotoxy(8,2);
    val=adc_conv();
    t=round(val*0.48876);
    char buffer[10];
    itoa(val,buffer,10);
    LCD_print(buffer);
     
     
    delay_ms(100);
    }
    return 0;
    }
     
    December 5, 2011 at 5:10 pm in reply to: problem regarding interfacing LCD using ATMEGA16 code by CHINMAY CHINARA #6910
    Tuhin
    Participant

    You have made a worng connection. Just see the back sibe of LCD and conform which pin is no1. and so on. Then connect it. I myself suffered from this problem.I’m giving you the pin configration of LCD you connect it as per your requirment.

     

    1.GND

    2.VDD(5V or 3V)

    3.V0(Contrast adjustment)

    4.RS

    5.R/W

    6.EN

    7.DB0

    8.DB1

       :

       :

       :

    14.DB7

    15.LED+(~ 4.2V)

    16.LED-(GND)

                Just see the backside of lcd and make sure  your connection is right or not.  

    November 20, 2011 at 5:28 pm in reply to: interface LCD with atmega 32 by anjum awasthi #6859
    Tuhin
    Participant

    Hi friends, if both of you want a solution of this problem you can mail in my id ([email protected])

    hope I can help you both.

    November 19, 2011 at 7:22 am in reply to: 4 bit LCD interfacing with ATmega32 #6853
    Tuhin
    Participant

    you just reffer \extremeelectronics.co.in\ and read the AVR lcd interfaceing tutorial. you may  download 

    the lcd.c , lcd.h, and myutils.h file and add source and header file to your main program and then you can easily use lcd as per your requirement.

     

     

    But remember if you are going to use this source file keep one thing in mind you have to connect the datalines of lcd DB4-DB7 with 0-3 no. pins of any port. you have to use the first 4 bits of any portof mcu

     

        k..

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)

RSS Recent Posts

  • Wien bridge oscillator January 19, 2026
  • Silicone insulated wire January 19, 2026
  • Op amp shock January 19, 2026
  • Is the input voltage selectable ? January 19, 2026
  • Unable To Get Advertised Op-Amp Slew Rate January 19, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise