camerart
Well-Known Member
Hi,
I'm trying to get a 16F819 to run with a 4X20 LCD screen using it's internal oscillator.
The program uses the pins where a XTL would be used.
Here is the code:
Define CONF_WORD = 0x3f72 'internal oscillator
Define CLOCK_FREQUENCY = 4 'Changed from 12
AllDigital
ADCON1 = 0x0e
Define SIMULATION_WAITMS_VALUE = 1 'SIMULATION ONLY
Define LCD_BITS = 8
Define LCD_DREG = PORTA
Define LCD_DBIT = 0
Define LCD_RSREG = PORTB
Define LCD_RSBIT = 0
Define LCD_RWREG = PORTB
Define LCD_RWBIT = 1
Define LCD_EREG = PORTB
Define LCD_EBIT = 2
Define LCD_READ_BUSY_FLAG = 1
Lcdinit
Dim an0 As Word
loop:
Adcin 0, an0
Lcdcmdout LcdClear
Lcdout "Analog input AN0"
Lcdcmdout LcdLine2Home
Lcdout "Value: ", #an0
Toggle RB4
WaitMs 250
Goto loop
Can anyone suggest why it doesn't run? or can I change the used XTL pins so that Ican use a XTL?
Camerart.
I'm trying to get a 16F819 to run with a 4X20 LCD screen using it's internal oscillator.
The program uses the pins where a XTL would be used.
Here is the code:
Define CONF_WORD = 0x3f72 'internal oscillator
Define CLOCK_FREQUENCY = 4 'Changed from 12
AllDigital
ADCON1 = 0x0e
Define SIMULATION_WAITMS_VALUE = 1 'SIMULATION ONLY
Define LCD_BITS = 8
Define LCD_DREG = PORTA
Define LCD_DBIT = 0
Define LCD_RSREG = PORTB
Define LCD_RSBIT = 0
Define LCD_RWREG = PORTB
Define LCD_RWBIT = 1
Define LCD_EREG = PORTB
Define LCD_EBIT = 2
Define LCD_READ_BUSY_FLAG = 1
Lcdinit
Dim an0 As Word
loop:
Adcin 0, an0
Lcdcmdout LcdClear
Lcdout "Analog input AN0"
Lcdcmdout LcdLine2Home
Lcdout "Value: ", #an0
Toggle RB4
WaitMs 250
Goto loop
Can anyone suggest why it doesn't run? or can I change the used XTL pins so that Ican use a XTL?
Camerart.