I have been trying to program an 18pin 16F88 for a project, my first attempt at using PIC chips. So far I haven't been able to get an LED to blink. I have this PIC-PG2C programmer:
I am just powering the PIC with +5V and Ground, someone also told me I might need to feed pin 4 high, or low, to keep the device from continuously resetting. Is that correct? I don't have an external RC attached and wish to use the internal clock, I set the ICProg configuration to "IntRC". The programmer programs and then verifies the programming, yet when I put the chip into a circuit with +5 on pin 14, ground on pin 5, and an LED between pin 17 and ground; the LED has a barely detectable blink to it, but when I connect pin 4 to +5 the LED remains on solid, and when I connect pin 4 to ground the LED turns off completely. Here is a link to the
16F88 data sheet:
I assume CCS C is a good compiler, but is there another one anyone would suggest?
Here is my source code: #include #fuses HS,NOWDT,NOPROTECT,NOLVP #use delay(clock=4000000) // Wait for one second void wait() { int count = 0; while(count < 100000) { delay_us(10); count = count + 1; } } // Blink the PIN void blink() { output_high(PIN_A0); wait(); output_low(PIN_A0); wait(); } void main() { while(TRUE) { blink(); } }
I have also read about PIC simulators, has anyone used one and can recommend it? My project involves gathering data from two to three voltage imputs (carbon di/monoxide detectors) and converting those voltages to ppm and outputing the values to an LCD display. Then calculating and storing or displaying the average over certain time spans. One step at a time though.