Re: PIC USART troubles
- From: "Anthony Fremont" <spam-not@xxxxxxxxxxx>
- Date: Sat, 3 Mar 2007 16:38:46 -0600
hybrid_snyper wrote:
On Mar 3, 7:31 pm, "Anthony Fremont" <spam-...@xxxxxxxxxxx> wrote:
Unfortunately, the internal USART outputs the signal using reversed
polarity so that a level converter (like a MAX232) will work with
it. If your T28 outputs a signal that an ordinary PC serial port
can read, then you will need to invert the output of the PIC so that
it can talk to the T28.
A PC can only read the signal when i use a special data cable,
dissected the cable and found a max232 in it, therefore any signal
You didn't say that before. I figured you used a standard cable. Tidbits
like this are extremely important.
conversion was done in the cable. I was under the impression that i
would not need a max232 to connect the PIC and T28 directly because
the MAX232 is used to bring a signal to RS232 standards.
Try connecting the PIC to the pc using the special cable and see if it's
working. Do you have a scope to verify the baud rate is correct.?
When the phone is sitting idle, what is the voltage on the TX and RX
pins? Compare those with the PIC.
Voltage on TX is 2.7V
Sounds like your phone may be 3.3V compatible. If so, it may not much like
you slapping it with 5V signals from the PIC. Try powering the PIC from 3V
and see what happens. Make sure brown out detect (BODEN) is not enabled.
I assume you are powering the PIC from 5V? If so, 2.7V will not register as
a 1 on a Schmitt trigger input, it is too low. The spec calls for .8 * Vdd
to be read as a logic 1. IOW, you need 4V to talk to the PIC. The phone
may be responding, you just aren't seeing it. This is another reason to try
running the PIC from 3V. You will only need 2.4V to be read as a logic 1.
That answers that. You need to invert the output of the PIC. Use an
inverter, logic gate (NAND, XOR, or NOT) or whatever you wish to
flip it over.
Could i ask why this is, is the output from the TX meant to be neg?
In TTL levels, the high would be +5 (or actually closer to 3V in your case)
and the low would be GND. In RS-232 world, a high is signified by -10V
(actually a range, but this is close enough). A low is signified by +10V
signal. This is what a MAX232 would do to the signals. Since your cable
has a MAX232 built in, you should be able to ignore what I said before.
Or you could bit-bang it. AFAIK, the PIC has no ability to invert
the output of the USART, stupid as that sounds.
Not sure what bit banging is but will look into it.
You won't like it. ;-)
Thanks for the speedy reply.
Wayne
.
- Follow-Ups:
- Re: PIC USART troubles
- From: hybrid_snyper
- Re: PIC USART troubles
- From: Anthony Fremont
- Re: PIC USART troubles
- References:
- PIC USART troubles
- From: hybrid_snyper
- Re: PIC USART troubles
- From: Anthony Fremont
- Re: PIC USART troubles
- From: hybrid_snyper
- PIC USART troubles
- Prev by Date: Re: LED question
- Next by Date: Re: PIC USART troubles
- Previous by thread: Re: PIC USART troubles
- Next by thread: Re: PIC USART troubles
- Index(es):
Relevant Pages
|