The serial data out was available at both RX (RB1) and TX (RB2) pins.
At first I suspected that both pins could be shorted together outside of
the chip, then I noticed that the RX pin signal was inverted.
Very odd, because I don't have any inverter on the board, not even a
transistor.
After too much fuss (even cutting tracks and removing components), I
found that I had the RX and TX pin directions reverted (TRISB register).
Then I corrected the pin directions and everything worked OK. It is
worthy noticing that bit CREN at RCSTA was turned off also.
I will restore the wrong code to confirm it all, but it is a very odd
behavior indeed, RX outputting the inverted signal when configured as
output.
Isaac
__________________________________________________
Fale com seus amigos de graça com o novo Yahoo! Messenger
http://br.messenger.yahoo.com/
--
http://www.piclist.com PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
nice one...
I'm using them and their USART and it's all ok.
I would be interested to know what values you ended up with for TRISB1
and TRISB2. The following comment is taken straight from the datasheet,
page 80:
"TRISB<1> and TRISB<2> should both be set to
‘1’ to configure the RB1/RX/DT and RB2/TX/CK
pins as inputs. Output drive, when required, is
controlled by the peripheral circuitry."
I noticed this for the first time yesterday when setting up USART on an
18F, but it appears to be the same for the 16F648A too.
Perhaps this is related to the problem you are having and maybe
following that advice would be the best.
David
I wonder, because Rx is hi-Z, if it might be some sort of reflected
signal, or a r-m-w effect. I've seen similar behaviour with other
signals when an input is next to an output or a shadow register
not used
> "TRISB<1> and TRISB<2> should both be set to
> ‘1’ to configure the RB1/RX/DT and RB2/TX/CK
> pins as inputs. Output drive, when required, is
> controlled by the peripheral circuitry."
This is the datasheet advice for many PICs and their other
comms modules
What are you connecting the RX/TX signals to?
Is there ANY chance that the PIC body diodes are being driven into conduction.
That can account for just about any behavior - a mere inversion of the
TX pins should be easy :-.
Russell
They work OK. You snipped the rest of my message where I tell what I was
doing wrong.
I was just pointing out the odd and unexpected behavior when not
correctly configured.
Isaac
__________________________________________________
Fale com seus amigos de graça com o novo Yahoo! Messenger
http://br.messenger.yahoo.com/
--
The subject of my message was misleading.
It was all about a mistake in my configuration of the serial port. I was
just pointing that the serial port exhibited a weird and unexpected
behavior *when ill configured*.
Isaac
__________________________________________________
Fale com seus amigos de graça com o novo Yahoo! Messenger
http://br.messenger.yahoo.com/
--
Yes.
Your post made sense but, even though I read it all and essentially
understood it one of the "little men" inside my head who runs around
answering questions saw the heading and was compelled to answer the
query :-). The one who noticed that the text proposed and solved its
own problem neglected to pass the information on.
> It was all about a mistake in my configuration of the serial port. I was
> just pointing that the serial port exhibited a weird and unexpected
> behavior *when ill configured*.
Yes. Something like that would have been a better subject line - but
all good fun.
R