Define the LCD port

Discussion in 'Embedded Systems and Microcontrollers' started by twister, Apr 7, 2009.

  1. twister

    Thread Starter Member

    Mar 31, 2009
    15
    0
    Hi guys, newbie here. I used 16F88 as my MCU and i define the port as below:

    Code ( (Unknown Language)):
    1. __16F88
    2.  __config _CONFIG1,_BODEN_OFF&_WDT_OFF&_LVP_OFF&_MCLR_OFF&_PWRTE_ON&_INTRC_IO
    3.  
    4. ; I/O pin assignments
    5.  
    6.     ifdef   __16F88
    7.  
    8. #DEFINE PGBTN   PORTB,6 ; page button   (S3)
    9. #DEFINE HDBTN   PORTB,7 ; hold button   (S2)
    10. #DEFINE BLDBTN  PORTA,7 ; blades button (S1)
    11.  
    12. #DEFINE RPM_IN  PORTB,0 ; rpm input
    13.  
    14. #DEFINE LCD_D7  PORTA,4 ; \
    15. #DEFINE LCD_D6  PORTB,1 ; |
    16. #DEFINE LCD_D5  PORTB,2 ; | LCD panel
    17. #DEFINE LCD_D4  PORTB,3 ; |
    18. #DEFINE LCD_E   PORTB,4 ; |
    19. #DEFINE LCD_RS  PORTB,5 ; /
    20.  
    As I need B5 as my hardware UART, i am planning to switch the LCD_RS to another port which is A6 (RA6/OSC2/CLKO),
    A6 buffer type is ST and i had it ground previously. However when I changed to RA6 and reconnect LCD port...it gives weird characters on the LCD.
    Is it possible to do it this way? Thank you.
     
  2. russ_hensel

    Well-Known Member

    Jan 11, 2009
    818
    47
    which compiler?
    in mine, #define is lowre case, there would be no ; at the end, and comments need to be proceeded by a comment indicator //

    I do not think i could compile the code above.
     
  3. twister

    Thread Starter Member

    Mar 31, 2009
    15
    0
    I am using PIC assembly and MPLAB as my compiler.:D
     
Loading...