Hey,
Im having trouble on a PIC16F88, as far as i can tell the code should be outputting the data on all eight pins of PORTB, but pins 4-7 are allways low, see the example below:
DEFINE OSC 8
Define LCD_DREG PORTB ' Port for LCD Data
Define LCD_DBIT 0 ' Starting Data bit (0 or 4) if 4-bit bus Use LOWER 4 bits of Port
Define LCD_RSREG PORTA ' Port for RegisterSelect (RS) bit
Define LCD_RSBIT 6 ' Port Pin for RS bit
Define LCD_EREG PORTA ' Port for Enable (E) bit
Define LCD_EBIT 7 ' Port Pin for E bit
Define LCB_BITS 8 ' Using 4-bit bus
Define LCD_LINES 4 ' Using 2 line Display
Define LCD_COMMANDUS 2000 ' Command Delay (uS)
Define LCD_DATAUS 200 ' Data Delay (uS)
init:
OSCCON = %01110000 '8 MHz Internal Oscillator
Pause 2000 'Safe Start Up Delay
CMCON = 7
ADCON1 = 7
ANSEL = %00000000
TRISA = %00000000
TRISB = %00000000
PORTA = %00000000
PORTB = %00000000
main:
LCDOUT %11111111
PAUSE 1000
goto main
end
Regards,
Daniel
Bookmarks