Can you show your schematics?
Can you show your schematics?
"No one is completely worthless. They can always serve as a bad example."
Anonymous
i'm sorry I am at university, and can't scan my schematics right now. But just to let you know I can successfully run this program on an 16F877...
I really don't know where is the problem. I do the PWM on the 18F but it seems it's not taking the instruction "IF" ??...
Thank you anyway...
If anyone else has a hint or something ?
Problem #1: RA0 (and more pins) are anlog inputs by default at power-up, and all pins configured as analog inputs will read 0 when used for digital I/O.
Solution = ANSEL0 = 0
Problem #2: This can cause read-modify-write issues since you have all pin aliases pointing to port pins VS port LATches;
Low led1
Low led2
Low led3
Low led4
Low led5
Low led6
Low led7
Low led8
Low led9
Low led10
Low led11
Low led12
Change your pin aliases to LAT like this and include the = sign;
Symbol led1 = LATB.5 'OUT, etc.
Thank you very much for your answer ! it works now !
If I need help again about another thing should I start another thread ? (gonna need to change duty cycle of pwm with potentiometer)
however, I do not want to be invasive.
You're welcome. For your other question, just continue on in the previous thread you started here http://www.picbasic.co.uk/forum/showthread.php?t=15149
This isn't exactly what you asked for, but here's a link to another thread for using the A/D on this PIC http://www.picbasic.co.uk/forum/showthread.php?t=6768
Bookmarks