Code works on 16F84A but not on 16F88?
I'm working on a project using a 16F88 to read an input voltage and act when the signal drops below a certain threshold. I had the program working on a 16F84A using an RC network and the POT command to simulate the voltage input, but in order to actually build the project I needed an A to D converter.
I got a 16F88 and can program it okay using my LABX-3 and my ICD2, my code compiles and programs, but nothing is happening on my PIC.
To test things out, I have removed everything from the circuit except the basics - 5V supply, decoupling cap, 4 MHz xtal + 2x 22pF caps, 100k resistor from RB3 to ground, and a 470R resistor in series with an LED to ground from RB4. This is the same as the LABX-18, which is designed around the 16F88. As far as I can tell, the big differences in the two chips are the locations of the TX and RX pins connected to the MAX232. My MAX232 is out of circuit.
Here is my code:
Code:
ANSEL = 0
CMCON = 7
OUTPUT PORTB.4
blink: PORTB.4 = 1
PAUSE 500
PORTB.4 = 0
PAUSE 500
GOTO blink
END
My config bits are set to:
Oscillator = XT
Watchdog timer, Powerup timer = OFF
MCLR is on
BODETECT = off
LVP is off
everything else is off.
This code works fine on a 16F84A. Am I doing something wrong with the oscillator selection? I would think that I could just tell it to use the XT oscillator, right? Do I have to tell it that it has a 4MHz xtal?