PDA

View Full Version : simple program, what am i missing



scorpion
- 15th September 2005, 17:58
Hi. I have a multi purpose board That i made using a pic16f676. I am using it for 2 hall effects to 2 PWM signals and it worked great... but now I am just trying to blink a couple of leds and its not working at all....

here is what i have (I cut the program way down to try to find the issues)

trisa = 0
trisc = 0

main:
low ledout
pause 350
low buzzerout
pause 50
high ledout
high buzzerout
pause 400
goto main

straight forward enough... but they are blinking at opposite times... is there something basic im missing?

mister_e
- 15th September 2005, 18:05
as i presume you place your stuff on the PORTA or else analog multiplexed, place those line before the main...


CMCON=7 ' disable analog comparator
ANSEL=0 ' disable A/D converter

<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=497&stc=1">

scorpion
- 15th September 2005, 18:11
sorry i did have cmcon = 7
but it wont compile if i set adsel

scorpion
- 15th September 2005, 18:15
where did you get that gif of me?
I was trying to compile it for the wrong pic.... i cant believe that it took me 2 days and a post to figure it out.....
thank you for your help

mister_e
- 15th September 2005, 18:45
S.h.i.t. happen ;)