PDA

View Full Version : 16F628A UART & B Ports Use



DJDave
- 18th January 2012, 23:34
First of all I'm relatively new to PIC programming but do have some circuits working.
I'm using the X3 experimenter board to set this project up.

I'm doing a project that requires 8 inputs and 8 outputs and am attempting to use the 16F628A for this.
I'm using Portb.2 USART to output commands to a device and that's working great.... but if I attempt to raise or lower the port nothing happens.
Do I need to temporarily enable/disable the USART?

In addition... is it possible to use all 8 of the A pins for input and all 8 of the B pins for output?
Let me know if you need more info. to reply... Thank you... Dave

mackrackit
- 19th January 2012, 10:30
Why are you using PORTB.2


but if I attempt to raise or lower the port
What do you mean?

And of course your code will help someone figure out what you are doing wrong

And

DATA sheets are your friend.
Please read the chips DATA sheet and make it happy :)

DJDave
- 20th January 2012, 15:16
Doesn't portb.2 share the same pin with the USART transmit?

mackrackit
- 20th January 2012, 15:54
Doesn't portb.2 share the same pin with the USART transmit?
Yes it does.

mackrackit
- 20th January 2012, 16:06
That is why it can not be

raise or lower
if I understand what you mean by that.