Cant read PIC usart data

To: alt.electronics,sci.elect Hi All,

Sorry in advance if this turns out to be double-posted, it seemed to bounce from one group the first time and im not sure if that means it bounces from all.

This might be a little OT on some groups, but I am having a little trouble getting my computer to read output from a pic microprocessor over a serial connection and i'm hoping its one of those "ah you just need to this" solutions an expert could tell me in seconds which would probably take me a couple of weeks to work out on my own.

I have an 18F1320 pic, which i've programmed to periodically send data out to a small radio transmitter (easyradio433TS) about once a second. It's about 10 bytes of assorted data, sending at aproximately 19200 baud (or there abouts) using the PIC's onboard usart.

the data out pin is connected to a small radio transmitter. So far so good, I can see data flowing out of the pic on my scope.

At the other end is a matched radio reciever, again, I can see that it is recieving what appears to be the same data that goes into the transmitter on my scope (ie all the bits in the same place, not inverted etc)

The reciever is supposed to handle logic level CTS/RTS RX/TX etc. The reciever is connected to a MAX232CPE RS232 interface chip which does all the voltage conversions required for logic/rs232 interfacing, which in turn is connected to my computers serial port by a cable.

Again all seems fine to this point, if I connect my scope up to the RS232 side, I see data pulsing down the line, and I can see the varying digitalness of each character representation.

On the PC I am using linux (debian, kernel version 2.6.8 (customised kernel) / gcc 3.3.5 (debian 1:3.3.5-13) for those that need to know) Platform is i386, SiS chipset (not sure of the exact chipset but its got a 651 AGP host bridge, and SiS 962 ISA bridge, and it's the standard

9-pin onboard serial port i'm using (only has one) i/o range 03f8-03ff). UART is a standard 16550A So any windows/dos suggestions will probably be wasted on me.

so anyway, I decide to try and read the data coming into my PC's serial port

cat /dev/ttyS0

which in theory should give me a nice display of the incomming data. only it doesnt, it just sits there doing not much more than an ice cube.

As a test to make sure the hardware was working (as best I can) I hooked the _logic side_ (ie the bit the radio is directly wired to) RX to TX, CTS to RTS and in another console did echo "hello" > /dev/ttyS0

Lo and behold, I recieved a big hello in the window that I did cat /dev/ttyS0. I also get a load of linefeeds (0x0A) which i'm not sure about, but it certainly appears to me that data is going both ways through the RS232 chip.

To note, I have also done cat /dev/ttyS0 | hexdump in an attempt to get hex data just in case it's garbaging the data somewhere along the line and sending non-printable characters. but still I get an integer less than 1.

now i've checked my wiring, i've double checked my wiring, i've tripple checked my wiring, and hooked LED's up here there and everywhere to see when data pulses through, and I can, the led's pulse as I would expect. I have removed the radio transmitter/receiver pair and tried to run the RS232 chip direct from the pic. nothing, zilch, nada, nil, 0.

Yet data is being send down the serial cable, to my pc's serial port, at

19200 baud. my pc just will not pick it up.

I have tried using the setserial utility to set the serial port to 19200 baud, again the output I got was the square root of 0.

I can think of only 4 possible causes for this problem:

  1. The reciever is sending out data with hardware flow control (RTS/CTS), yet my serial port is probably set to software flow control (Xon/Xoff). or any other number of serial port perameters are not met, such as start bits, stop bits, parity, number of mars bars etc. I can just about set the baud rate, but I have no idea how to set all these other parameters since i've not had to do anything like this since the early 90's, and back then I was using Dos. and so far i've not been able to find anyone that can give me a straight answer (resorting to the default rtfm reply - which manual? all setserial seems to do is set the baud rate and a number of seemingly unrelated things). Any advice or pointer to a really good info. resource on this would be greatly appreciated.

  1. As above, but may be easier to set the PIC to manage software flow control, parity etc. if so, how do I find out how my serial port is set up in terms of parity, start/stop bits etc?

  2. The receiver (an Easyradio 433RS) mentions something in the datasheet about the output being inverted? so it can be directly interfaced with a pic. ie logical high = 0v, logical low = 5v. Apparently the MAX232CPE deals with this, but is this true? do I need to put an inverting buffer between the reciever pins and the max232?

  1. I am slowly going insane and everything is working perfectly, my brain is making me believe a problem exists where in reality I havent even got a computer.

Thanks for any tidbits of advice, Mark

--
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out
free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24
Reply to
Mark Fortune
Loading thread data ...

To: alt.electronics,sci.elect Compare very carefully the waveforms going into your computer when you connect it directly vs. through the radio transmitter.

--
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out
free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24
Reply to
mc

To: alt.electronics,sci.elect Mark,

What is the EasyRadio ? Is it designed to handle NRZ data ? Many radio links use an adaptive style data slicer that requires some preamble to set it up and usually the data needs to be DC balanced (long runs of "1" or "0" cause errors) so some form of Manchester coding is usually utilized.

Can you capture the received data and analyze it for missing bits ?

Kind Regards

David

----------------------------------------------------------- ORBIT COMMUNICATIONS Pty Ltd - Wireless Solutions that Work (Telemetry, Control, Monitoring, Security, HVAC ...) A.C.N. 107 441 869

Website :

formatting link
PO Box 4474 Lakehaven NSW 2263, AUSTRALIA Ph> Hi All,

--
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out
free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24
Reply to
David

To: alt.electronics,sci.elect

There will be no PICs in the near future . ARM cpu's will kill everything made .

Computers , when they change , destroy hardware in the 100's Millions of $$ and RIF millions of jobs !

Just ask Sun microsystems in 2001 !! It took Nasdaq from 5000 to

1200 !

And its so easy to improve hardware and software ! but govts have stiff penalties for improving . But s/w is slow to change for they have obtuse hardware ( PC ) , but when a new CPU comes along that nix's need for North/South bridge , FDC , HDC ....

PDAs have an ARM CPU that burns 2 watts and has all these chips built in . It can do giga bytes , and 100's of MegaFlops , which means , some one will find it much easier to create a free OpSys on the easier h/w .

Linux is actually tied to the PC , it can't migrate to PDA , for it will be obsoleted by the FREE OpSys that has not the problems with simple stuff like Files/Folders ( Linux cant do this stuff )

I will do a free OpSys . It manages all objects /Files/folders . It will be totally integrated . No separate HLL to load , you can create assmbly code from high level , in place , and run it imediately .

Mark Fortune wrote:

--
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out
free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24
Reply to
werty

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.