CluckShot
- 15th May 2007, 01:22
I am taking the standard program to demo the PIC16F877A as a clock and starting to branch out leaning as I go. Sorry if I am just leaning but I could really use some help The problem obviously is in configuration of the ports and interrupts.
Since the PIC18F4620 has several timers rather than the one of the PIC16F877A I assume that some sort of configuration for setting the interrupts on should be done differently but I am not entirely able to get this down. Chalk it up to learning but I need some help on this one.
I will include my defines and the settings and what should be printing out. The rest of the program really is quite generic.
Defines --
Define LCD_DREG PORTD ' Define LCD connections
Define LCD_DBIT 4
Define LCD_RSREG PORTE
Define LCD_RSBIT 0
Define LCD_EREG PORTE
Define LCD_EBIT 1
ADCON1 = 7 ' PORTA and E digital
Low PORTE.2 ' LCD R/W low = write
' Set TMR0 to interrupt every 16.384 milliseconds
T0CON.7 = 1 ' Set Timer0 on!
T0Con.6 = 0 ' Set as a 16 bit timer/counter
T0Con.5 = 0 ' Set the internal clock active
T0Con.4 = 0 ' Set Source edge bit = low to high on T0CLKI pin
T0Con.3 = 1 ' Bypass the prescaler (Revisit this one!)
T0Con.2 = 0 ' Prescaler settings
T0Con.1 = 0
T0Con.0 = 0
TRISD = %11111111
'PSPCON = 0
'OPTION_REG = $88 ' Set TMR0 configuration and enable PORTB pullups
Enable interrupt ' Enable TMR0 interrupts
'INTCON =
On Interrupt Goto tickint
-===
If you go to the standard clockx example on the melabs site you get the rest of the code, I really don't expect it to be of much interest.
My issue is that the system has an led that flashes with each interrupt and it appears to be working just fine. The problem is that the LCDOUT writing per this program is not working. It works just fine with the PIC16F877A chip.
Help Please
Since the PIC18F4620 has several timers rather than the one of the PIC16F877A I assume that some sort of configuration for setting the interrupts on should be done differently but I am not entirely able to get this down. Chalk it up to learning but I need some help on this one.
I will include my defines and the settings and what should be printing out. The rest of the program really is quite generic.
Defines --
Define LCD_DREG PORTD ' Define LCD connections
Define LCD_DBIT 4
Define LCD_RSREG PORTE
Define LCD_RSBIT 0
Define LCD_EREG PORTE
Define LCD_EBIT 1
ADCON1 = 7 ' PORTA and E digital
Low PORTE.2 ' LCD R/W low = write
' Set TMR0 to interrupt every 16.384 milliseconds
T0CON.7 = 1 ' Set Timer0 on!
T0Con.6 = 0 ' Set as a 16 bit timer/counter
T0Con.5 = 0 ' Set the internal clock active
T0Con.4 = 0 ' Set Source edge bit = low to high on T0CLKI pin
T0Con.3 = 1 ' Bypass the prescaler (Revisit this one!)
T0Con.2 = 0 ' Prescaler settings
T0Con.1 = 0
T0Con.0 = 0
TRISD = %11111111
'PSPCON = 0
'OPTION_REG = $88 ' Set TMR0 configuration and enable PORTB pullups
Enable interrupt ' Enable TMR0 interrupts
'INTCON =
On Interrupt Goto tickint
-===
If you go to the standard clockx example on the melabs site you get the rest of the code, I really don't expect it to be of much interest.
My issue is that the system has an led that flashes with each interrupt and it appears to be working just fine. The problem is that the LCDOUT writing per this program is not working. It works just fine with the PIC16F877A chip.
Help Please