Ive found out whats happening. Its weird though and i dont know how to fix it.
Code:high porta.1 'Turns RA1 on high porta.0 'Turns RA0 on *AND* RA1 back off again!
Ive found out whats happening. Its weird though and i dont know how to fix it.
Code:high porta.1 'Turns RA1 on high porta.0 'Turns RA0 on *AND* RA1 back off again!
You should give all info in each thread. Saves the people trying to help time if they do not have to go back and search your old post. I for one will not take the time. A minute or so of your time telling the PIC and posting the whole code will get answers, or at least better answers
Look at these:
http://www.picbasic.co.uk/forum/showthread.php?t=562
http://www.picbasic.co.uk/forum/showthread.php?t=561
Basically if you want the pin to be digital, tell it. If the pin is to be analog, tell it. Just like setting the TRIS.
Dave
Always wear safety glasses while programming.
Sorry. I did post a link to the datasheet. The exact chip is a PIC16F627. The datasheet doesnt mention ADCON anywhere so i assume it doesnt have it. Ive tried setting CMCON. I took a look again at the datasheet and tried a few values. Ive now found one that seems to work properly. From what i can see, all of porta is working as expected now.
While testing ALL pins ive noticed another problem. RB0 wont turn off. Im sure this is because its a special pin but i cant see what to do with it.
In that first link RA4 isnt a problem because its an input anyway.
Ive attached the full code so far as requested. Everything seems to work except RB0
HAHA. I found the problem. When i set all the pins low i put "portb.2" instead of "portb.0".
Everythings working nowThe circuit can control mains bulbs and/or LEDs with brightness control.
Im sure your all thinking "THANK GOD. Finally". I would like to thank everyone who has helped me with this. It looked really simple when i first started but if it wasnt for the people on this forum i would be hitting my head on the table right now.
Ive just got a few bits of code to add and cleanup then it should be done but im sure i can handle those myself
I hate it when that happensWhen i set all the pins low i put "portb.2" instead of "portb.0".![]()
Good job![]()
Dave
Always wear safety glasses while programming.
Bookmarks