I am using 16F690 and try to write a string to 16x2 LCD. (16F690 PORTC , c0-c3 data bit, c4 RS and c5 enable) However, the software didn't work to run LCD. So, I changed it to a simple test code to test PORTC enable/disable. I have a LED conneted to C7 bit. The program can run successful by MikroPro. but, no luck on Hi-TECH C (verision 9.65)
Your feedback are highly appreciated
#include <htc.h>
#include "stdio.h"
#include <string.h>
__CONFIG(MCLRDIS & UNPROTECT & WDTDIS & PWRTDIS & XT );
void main(void)
{
PORTC = 0;
TRISA = 0xff; // PORT A input, Bit 2 AN2 input
TRISB = 0xc0; // Port B , RB7 & RB6 are input
TRISC = 0x40; // all PORTC output
ANSEL = 4; // Read AN2
ANSELH = 0;
CM1CON0 = 0;
CM2CON0 = 0;
C1ON=0; // Turn off Comparators
C2ON=0;
DelayMs1(100);
// I'm expecting LED (C7) blinking.
do {
PORTC =0;
DelayMs1(100);
PORTC= 0xff;
DelayMs1(100);
} while (1);
}
Your feedback are highly appreciated
#include <htc.h>
#include "stdio.h"
#include <string.h>
__CONFIG(MCLRDIS & UNPROTECT & WDTDIS & PWRTDIS & XT );
void main(void)
{
PORTC = 0;
TRISA = 0xff; // PORT A input, Bit 2 AN2 input
TRISB = 0xc0; // Port B , RB7 & RB6 are input
TRISC = 0x40; // all PORTC output
ANSEL = 4; // Read AN2
ANSELH = 0;
CM1CON0 = 0;
CM2CON0 = 0;
C1ON=0; // Turn off Comparators
C2ON=0;
DelayMs1(100);
// I'm expecting LED (C7) blinking.
do {
PORTC =0;
DelayMs1(100);
PORTC= 0xff;
DelayMs1(100);
} while (1);
}