Menu

LCD and 16f648a

Help
2007-01-24
2013-05-30
  • Nobody/Anonymous

    Works like a charm with 20mhz crystal and 4 bit mode.  Used DB4-7 on RB0-4, and RS, R/W, & E on RB5-7 respectiely.  Thanks everyone for your help.

    Was not able to get the 16f684 to work, but should do so with proper initialization and timing.

    Regards,
    Kent

     
    • Sterling Youngman

      Kent, can you elaborate. What PIC are you using and any other info we should be aware of?

      -Sterling

       
    • Nobody/Anonymous

      It's a 16f648a, an 18 pin device.  Here is the code setup which is no big deal.  Can't remember now, but RB4 didn't work for me, maybe because of LVP_OFF in config word?.  Make sure your grounds are tied together if you are using two different boards, or power supplies.  Good luck.

      Kent

      'Chip model
      #chip 16f648a,20
      #config  _CP_OFF & _DATA_CP_OFF  &_WDT_OFF & _BODEN_OFF & _PWRTE_ON & _HS_OSC & _LVP_OFF

      #define LCD_IO 4
      #define LCD_DB4 PORTB.0
      #define LCD_DB5 PORTB.1
      #define LCD_DB6 PORTB.2
      #define LCD_DB7 PORTB.3
      #define LCD_RS PORTB.5
      #define LCD_RW PORTB.6
      #define LCD_Enable PORTB.7

      Start:
      wait 1 sec
      Print "HELLO WORLD??"

      count=0
      for add = 0 to 9
      count = add + 1
      Locate 1,0
      LCDInt (count)
      wait 50 10ms
      next add

      cls
      goto Start 

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.