|
|
View previous topic :: View next topic |
Author |
Message |
Jeremy Duarte Guest
|
PIC16F628, I/OS do not respond, TX is inverted |
Posted: Tue Jul 22, 2003 1:02 pm |
|
|
Hi everyone,
I have a strange problem with a PIC16F628.
I am using pin A0, A1, A2 as I/Os, the comparators are shut down. My program was working well until I decided to connect TTL signals coming from different equipment to pin B4, B5, B6.
B4, B5, B6 are configured as inputs.
The same program behave strangely, A0, A1, A2 do not change any more and the transmit pin of the UART gets inverted. When I send something I get the opposite.
But when I disconnect the data lines from pin B4, B5, B6 everything works again.
I use fixed i/os. Here are the configuration bits I set in MPLAB
with the PICStart Plus : crystal HS (20MHz), Watchdog disabled, power up is on, brown out is on, everything else is disabled.
Even if I try this very simple program the problem occurs:
#include "pic16f628.h"
#use fixed_io(outputs_a=PIN_A0, PIN_A1, PIN_A2)
#use rs232(baud=4800, xmit=PIN_B2, rcv=PIN_B1)
void main()
{
CMCON=0x07; // comparator shut down
output_a(0xFF);
while(1)
{
output_low(PIN_A0);
delay_ms(1000);
output_high(PIN_A0);
delay_ms(1000);
}
}
What could be wrong?
Thanks in advance.
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516250 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
Re: PIC16F628, I/OS do not respond, TX is inverted |
Posted: Tue Jul 22, 2003 1:13 pm |
|
|
:=My program was working well until I decided to connect TTL signals coming from different equipment to pin B4, B5, B6.
:=B4, B5, B6 are configured as inputs.
-----------------------------------------------------------
First thought: RB4 is the PGM pin on this PIC.
Do you have NOLVP in the #fuses statement ?
If not, put it in there.
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516253 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|