-
18F877A to 18F876A
Hello
I can get the following code to work correctly with an 18F877A on the X-1 board. Then I load the same code into an 18F876A and the light won't blink. I am taking power and ground from the X-1 board to pins on the back of a 28-pin adapter to test the 876A.
Can I use the 28-pin adapter for testing purposes? Is there something I am missing that is different between the 877A and the 876A? I have tested the LED so I know its not burnt out. Also I have tried three 876A PICS. Any input appreciated. Also I am learning how to set registers. Please advise concerning ADCON1, CMCON etc assuming commented input/output signals for each pin
Thanks
Toby
include "bs2defs.bas"
ADCON1=%00000111 'Turn off PortA A/D's
CMCON=%00000111 'Turn off Port A Comparator
OPTION_REG.7=0 'Enable Pull-Ups for BCD
TRISA = %111110 ' Port A0=LED PortA1-5=Digital Inputs
TRISB=$FF 'Port B Input for BCD
Light Var PortA.0
Flasher VAR byte
Flasher = 0
repeat
GOSUB ON_Off
Flasher = Flasher + 1
UNTIL Flasher = 2
On_Off:
HIGH Light
PAUSE 500
LOW Light
PAUSE 500
RETURN
-
Hello Tobias,
Did you take the time to look at the datasheets on each of the uP's to see what the differences are in the settings.
You do realize the pinouts are different between the two. If you only took power from the X1 and connected it to the 28 pin then what have you done with MCLR? It needs to be tied to Vdd in order for the chip to work properly. As I glanced over the datasheet (it's the same for both) I didn't see any differences in the registers with a quick scan but I could be wrong. Also the "A" version chips need a .1uF bypass capacitor as close as possible to the power pins. What are you using for an oscillator, internal or external, and if external how do you have it connected to the adaptor?
HTH,
BobK
-
Bob I figured it out. Internal OSC!!! Does my ADCON etc look correct for configuring the ports? I am going to go with a 16F866 with the internal OSC. Whats the benefit of an external OSC?
-
18f ?
I Guess 16F not 18F
16F877A to 16F876A ???
not 18F877A to 18F876A
-
1) 16F876A has no internal OSC
2) your program work... even if he will fall in a under-stack event soon.
3) your ADC/Comparator settings are OK
4) external OSC is needed if you need timing accuracy. Internal OSC are nice, but shift with temperature, humidity, gas price, CAN$-USD$-CAN$ currency, wind direction etc etc. For most jobs they're nice enough and give 2 free i/o.
HTH