CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PIC16F628, I/OS do not respond, TX is inverted

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Jeremy Duarte
Guest







PIC16F628, I/OS do not respond, TX is inverted
PostPosted: Tue Jul 22, 2003 1:02 pm     Reply with quote

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

View user's profile Send private message

Re: PIC16F628, I/OS do not respond, TX is inverted
PostPosted: Tue Jul 22, 2003 1:13 pm     Reply with quote

:=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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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