View Full Version : Problems starting an 18F8720
sebastien
- 19th April 2010, 07:56
High i try to start a basic blinking led, on a 18f8720, but no success, anyone knows config bits i should set to make this chip works ?
My code looks something like this.
main:
HIGH PORTA.1
PAUSE 300
LOW PORTA.0
PAUSE 300
goto main
I tried disabling WDT, HSPPL, and multiple different combinations of config bits but nothing did it.
Its not a code problem but i have no clue on how i can debug/ troubelshoot the pic, this is pre-build card with the pic and pinouts.
Should I consider that, because the pic is programmable, its most likkely not blown, i just have to find the right bits, or can it be that it's programmable but will never start because its faulty ?
Regards.
Kamikaze47
- 19th April 2010, 10:38
Have you tired disabling the analog-digital converter?
ADCON0=%00000000
ADCON1=%00001111
sebastien
- 19th April 2010, 13:45
Thanks for the reply i will give it a try when going home,
i know adcon can give unexpected behavior sometimes, but i did'nt know it can simply avoid you pic to run a simple blink led.
Kamikaze47
- 19th April 2010, 13:49
if the pin the LED is on is also an AD pin, then yes it will stop it if that pin is configured for analog use.
Also, there is a problem in your code if you want the LED to blink. HIGH PORTA.1 will put port A, pin 1 high and LOW PORTA.0 will put port A, pin 0 low and thats where they will stay. Nothing will blink.
sebastien
- 19th April 2010, 14:01
my mistake in the code i typed over, i tried with pins on almost every port.
B, H, A with the same result always. Not blinking. Therefore i have doubts over the device, how can i troubleshoot this ...
Kamikaze47
- 19th April 2010, 14:24
Hard to say without more information like the entire code, config settings and hardware setup. Are you using an external OSC?
sebastien
- 19th April 2010, 14:46
This pic is on a card with an osc onboard of 6mhz supposed to be ran on 24mhz thanks to hsppl.
Here is a pdf of the card, (it's in thai) but the last 2 pages are the wiring diagrams.
http://www.steitec.net/media/products/0000868001249723519.pdf
Kamikaze47
- 19th April 2010, 14:53
Can you post your code and config settings.
sebastien
- 19th April 2010, 17:09
Came back home and done it over again, played a bit with the config bits and it started to blink with and without adcon, one config bit i have removed was LVP .... that should not interfere execution.;.. but ok it works now thanks for the support.
Powered by vBulletin® Version 4.1.7 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.