PDA

View Full Version : First time trying to flash one LED



firsttimer
- 28th December 2013, 15:52
I have wrote and programmed PIC and tested the circuit which very simple yet it wont work,


LED var portb.0
trisb = %11111110
main:
high led
pause 1000
low led
pause 1000
goto main
end

I have tried fused xt and also hs
I hope you can help thanks.

I have done all this before and am now returning but I cant get of square one.

wdmagic
- 28th December 2013, 16:33
which PIC are you using, I had alot of problems the first time doing the same thing. I would set if possible the crystal setting to INT to use internal first. I blew several chips by setting them to xt and such without a crystal attached/attached properly. nowadays for the most part I try to use the internal occillator. also try to keep it even more basic than what you have here, like this


TRISB = 0
MAIN:
PORTB.0 = 1
PAUSE 1000
PORTB.0 = 0
PAUSE 1000
GOTO MAIN
END

or


TRISB = 0
MAIN:
TOGGLE PORTB.0
PAUSE 1000
GOTO MAIN
END

dont forget to set fuse settings, I usually turn WDT, BODEN, and MCLRE all to Disabled

Demon
- 28th December 2013, 16:38
First, what PBP and assembler version, model of PIC, all CONFIGs?

It would be a good idea to post your entire code. A circuit schematic would also be a good idea, just in case.

The more info you present, the easier it is to help.

Side note; is port B digital, analog features disabled?

Robert


Edit: don't you hate writing a post at the same time as someone else, and finishing second? :D