PDA

View Full Version : Rb1 Problem On A 16f819..



Calco
- 8th April 2004, 18:41
Hi,

Im having troubles with a 16F819, primarily with RB1.
What Iam trying to do to save I/O is use a bicolour LED with one end referenced to 2.5v and the other end tied to the PIC's output pin.
This setup works perfectly for RB0, RB2 & RB3 but not for RB1.

I can however get the 4 LED's to change if i do something like

portb=$FF followed by portb= $00

with a 500ms pause between them they merrily flash red and green all day.

Ive run through the datasheet a few times and it is still baffling me.

Anyone else had this problem?

Any thoughts?

Regards

Darryl..

Melanie
- 14th April 2004, 15:48
I can't replicate your problem...

Two Resistors 330R each in series between Vdd and Vss (not exactly power-saving - but who cares...). The junction of which has a bi-colour LED nailed to it, the other end of the LED is glued to PortB.1

Example...

LedOne var PortB.1
.. ..

MainLoop:
Toggle LedOne
Pause 10
Goto MainLoop

change the pause time for quicker or slower effect... from blink Red/Green to 'continuous' Orange.

Melanie

Calco
- 14th April 2004, 16:09
Hi Melanie,

I'll give that a try. I did manage to make it function (hit the deadline!!) but it was very badly constructed programming.

Basically I added 1 to the value (x) for port 1
2 for port 2, 4 for port 3 etc. at the end I simply used Portb=x

This worked fine.

Still didnt solve the odd behaviour of rb1.

I did notice on the datasheet that rb1's output pin is internally different to rb0,2 & 3 though perhaps that has something to do with it.

Thanks anyway

Regards

Darryl..