+ Post New Thread
Results 1 to 8 of 8
  1. #1
    Junior Member level 2
    Points: 954, Level: 7

    Join Date
    Aug 2012
    Posts
    23
    Helped
    4 / 4
    Points
    954
    Level
    7

    LCD 4bit mode interfacing with ATMEGA16/32 . Not working with external Crystal

    Dear all,

    I have made LCD 4 bit program for interfacing with atmega32a by Atmel studio.And tried out simulation in Proteus.
    It works with perfectly in the mode of Internal clock mode. Not working when put it in external crystal mode (ie, Fusebit CKSEL 1010 -11110)
    i am uploaded the whole program including proteus file please help me . I am banging my head from the morning .

    •   AltAdvertisment

        
       

  2. #2
    Super Moderator
    Points: 69,598, Level: 64
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,212
    Helped
    3248 / 3248
    Points
    69,598
    Level
    64

    Re: LCD 4bit mode interfacing with ATMEGA16/32 . Not working with external Crystal

    Hi,

    I donīt see any crystal. I donīt see itīs frequency. I donīt see itīs capacitors.
    I donīt see a schematic at all.

    If you think the problem is because of the crystal, then why donīt you give use informations about the crystal?

    Klaus



    •   AltAdvertisment

        
       

  3. #3
    Junior Member level 2
    Points: 954, Level: 7

    Join Date
    Aug 2012
    Posts
    23
    Helped
    4 / 4
    Points
    954
    Level
    7

    Re: LCD 4bit mode interfacing with ATMEGA16/32 . Not working with external Crystal

    oh sorry , I wrongly uploded the Zip file without connecting crystal and cappaictor in the above circuit realy sorry . i used a crystal 12 MHz with two 22pf cappacitor as shown below
    http://obrazki.elektroda.pl/4897824300_1484710245.png

    I reinstalled the Proteus program .After that the said program run correctly where i have get the display at the LCD.

    But the program not run in real hardware . i rechecked the connections ,And tested with an LED blinking program which working perfectly .
    I also checked with other 8 bit LCD program from google and working perfectly .
    But mine not working

    I am using usbAsp (slow mode-SCK Jumper-connected) programmer .



    •   AltAdvertisment

        
       

  4. #4
    Junior Member level 2
    Points: 954, Level: 7

    Join Date
    Aug 2012
    Posts
    23
    Helped
    4 / 4
    Points
    954
    Level
    7

    Re: LCD 4bit mode interfacing with ATMEGA16/32 . Not working with external Crystal

    Dear all what wrong with this code ,properly work in proteus but not in hardware.
    Code:
    /*
    
    #define F_CPU 12000000UL
    #include 
    #include
    #define LCDPORT PORTC   // Renaming the PORTD to LCDPORT
    #define RS PC2          // Renaming the RS pin to 2 
    #define E PC3            // Renaming the E to number 3
    #define LINE2 lcd_cmd(0xc0);  
     void latch(void)  // used to a high to low pulse the pin E
     {
    	 PORTC |= ~(1<
    

    Click image for larger version. 

Name:	Capture.PNG 
Views:	6 
Size:	39.2 KB 
ID:	135434



  5. #5
    Banned
    Points: 5,417, Level: 17

    Join Date
    Jun 2016
    Posts
    1,159
    Helped
    126 / 126
    Points
    5,417
    Level
    17

    Re: LCD 4bit mode interfacing with ATMEGA16/32 . Not working with external Crystal

    Post your exact hardware circuit. Show the fuses that you have written to the chip.



    •   AltAdvertisment

        
       

  6. #6
    Junior Member level 2
    Points: 954, Level: 7

    Join Date
    Aug 2012
    Posts
    23
    Helped
    4 / 4
    Points
    954
    Level
    7

    Re: LCD 4bit mode interfacing with ATMEGA16/32 . Not working with external Crystal

    The post #4 has my actual circuit and the fuse bit is Click image for larger version. 

Name:	Capture.PNG 
Views:	3 
Size:	7.7 KB 
ID:	135457



  7. #7
    Super Moderator
    Points: 69,598, Level: 64
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,212
    Helped
    3248 / 3248
    Points
    69,598
    Level
    64

    Re: LCD 4bit mode interfacing with ATMEGA16/32 . Not working with external Crystal

    Hi,

    The post #4 has my actual circuit
    I doubt that this exactely is your hardware setup: Power supply, decoupling capacitors, reset circuit...

    Klaus



  8. #8
    Junior Member level 2
    Points: 954, Level: 7

    Join Date
    Aug 2012
    Posts
    23
    Helped
    4 / 4
    Points
    954
    Level
    7

    Re: LCD 4bit mode interfacing with ATMEGA16/32 . Not working with external Crystal

    2,3 days tried out .the same sir .

    And i taken some of Lcd interfacing circuit with including hex program ,most of them works correctly in that hardware .
    I am using atmel studio 6
    Last edited by gelectron; 19th January 2017 at 17:00.



--[[ ]]--