B
Brian KP
- Jan 1, 1970
- 0
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:
http://www.olimex.com/dev/pic-pg2c.html and am using the ICProg program
the manufacturer said is compatible. I am currently using CCS C
compiler that I received from a friend who has worked with PICs
before, but haven't figured how to use CCS from within MPLAB and
currently just double click the executable in its directory and it asks
for the location of the source code and spits out a hex file. I have
the 16F88.h file in the same directory, and CCS C reports no errors.
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:http://www.robotstore.com/download/247097.pdf
I assume CCS C is a good compiler, but is there another one anyone
would suggest?
Here is my source code:
#include <16F88.h>
#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.
attempt at using PIC chips. So far I haven't been able to get an LED to
blink. I have this PIC-PG2C programmer:
http://www.olimex.com/dev/pic-pg2c.html and am using the ICProg program
the manufacturer said is compatible. I am currently using CCS C
compiler that I received from a friend who has worked with PICs
before, but haven't figured how to use CCS from within MPLAB and
currently just double click the executable in its directory and it asks
for the location of the source code and spits out a hex file. I have
the 16F88.h file in the same directory, and CCS C reports no errors.
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:http://www.robotstore.com/download/247097.pdf
I assume CCS C is a good compiler, but is there another one anyone
would suggest?
Here is my source code:
#include <16F88.h>
#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.