#include <16f877a.h>
#use delay (clock = 20000000)
#fuses NOWDT,NOPUT,HS,NOPROTECT
#include <LCD.C>
#define INTS_PER_10SECOND 153 // (4000000/(4*256*256*0.1))
BYTE ten_seconds; // A running seconds counter
BYTE int_count; // Number of interrupts left before ten second has elapsed
#int_rtcc // This function is called every time
void clock_isr() { // the RTCC (timer0) overflows (255->0).
// For this program this is apx 76 times
if(--int_count==0) { // per second.
++ten_seconds;
int_count=INTS_PER_10SECOND;
}
}
Can anyone check the problem for the above code? I m using 4Mhz crystal oscillator, and i would like to count for every 10 seconds... I had refered to the examples in ccs..
The code below is about interrupt and lcd display:
My interrupt pin is RB0 (INT) and RA0 to RA3 are my output pins connected to LCD pin 11 to 14.
Anything wrong in the code above kindly correct me.
Because its cannot display anything..
Hi khwoo,
If you look at the driver file LCD.c in your
<C:\Program Files\PICC_vxxx\Drivers>
folder you will see:
// As defined in the following structure the pin connection is as follows:
// D0 enable
// D1 rs
// D2 rw
// D4 D4
// D5 D5
// D6 D6
// D7 D7
//
// LCD pins D0-D3 are not used and PIC D3 is not used.
// Un-comment the following define to use port B
// #define use_portb_lcd TRUE
What this means is that the CCS LCD driver will only work on Port D or Port B the way it is.
Is it possible to switch your LCD to Port D? This would be the easiest fix. I know that someone on the CCS forums has a driver for other ports, but that may be more difficult to understand, and I think you just need to get up and running at this point.