Admins don't always have time to read all posts on all threads!
Let's be nice people - or let me rephrase that - Let's be nice on this forum....
I know it's tempting to reply to almost every newbie "Read the Manual or Read the Datasheet", I've done it myself to folks - and not just once or twice. It's frustraiting to read some of the posts, especially when there's a 14-page list of what they have to do/achieve and it's coupled with a request for schematics/code/help/complete ready-canned solution for free and the deadline is today lunchtime and they've still got to play a soccer match in the interim - oh, and by the way they haven't got a clue about electronics/programming, they're really a philosophy student that's been landed with the task.
OK, we've heard it all before! Sometimes it's better not to answer, and people might get the message that they are expected to make some effort themselves too. And if they're really that clueless then a Landscape Gardening project (growing a dwarf Marijuana or similar) is probably a better student option.
With all the spam and viri floating around these days, I'm surprised you have any time to read any of the posts...
Whoa! Where'd that come from?And if they're really that clueless then a Landscape Gardening project (growing a dwarf Marijuana or similar) is probably a better student option.
I thought I might have burnt out my PIC so I started trying very basic commands to test it out. Just output a voltage high on one pin when there's a voltage high on the input pin. This is the code I used:
DEFINE OSC 8
TRISA.1 = 1
TRISA.2 = 0
LOOP:
IF PORTA.1 = 1 THEN HIGH PORTA.2
GOTO LOOP
END
I used a VDD of 5V and got an output of 5V at A.2 but sometimes it will suddenly drop to 0 volts without me adjusting anything. I remove the pic from the circuit and then put it straight back in and the output is at 5V again. Sometimes the voltage stays for a while sometimes it goes away rapidly. Does it sound like my PIC might be faulty? or is there a problem in my code. Also if the PIC is outputing a high and I remove the high input I would expect the output to drop as well, but it doesn't. Do I need to include a second IF, THEN statement to achieve this result?
If you read the code inside your 'LOOP', there's nothing there to tell the pin to go low if the input goes low...therefore...
DEFINE OSC 8
TRISA.1 = 1
TRISA.2 = 0
LOOP:
PORTA.2 = PORTA.1
GOTO LOOP
Also, check your datasheet regarding PortA and analog settings, section 12.0 of the PIC16F88 datasheet. You might see something there that might throw a wrench into your master plan!![]()
I switched up to using B.1 as an input and B.2 as an output along with the portb.1=portb.2 and it worked well. After about 13 seconds, however, it stops working. Is this due to the fact that I'm relying on the internal oscilator or is there additional code that I don't know about. Also I looked over 12.0 and I see that PORT A pins would need additional lines of code to work, but I'm not fully understanding what their saying. Do the pins for PORTA have to be used for A/D conversion?
Bookmarks