how to interface
BebopALot
Posts: 79
Hi folks,
I have recently constructed a measurement instrument with the SX and I need to evaluate the data that the SX is storing. Preferably I'd like to see it in my PC. Anyone have any ideas on what I should do to read the chip output to my PC? I need to transfer 12 bits from the SX every 10ms and go over the results later (such as a time interval of 1 second = 100 data points, not real time).
I am sure the tech boys have something for this?
Thanks in advance,
BBAL
I have recently constructed a measurement instrument with the SX and I need to evaluate the data that the SX is storing. Preferably I'd like to see it in my PC. Anyone have any ideas on what I should do to read the chip output to my PC? I need to transfer 12 bits from the SX every 10ms and go over the results later (such as a time interval of 1 second = 100 data points, not real time).
I am sure the tech boys have something for this?
Thanks in advance,
BBAL
Comments
RS232 serial is often a good way to go because so many PC programs already are able to receive it. But adding it to an existing project may be hard because of the need to precisely time the serial bits.
One way to send RS232 is to add a virtual periferal with an interrupt sending bits at the right time. If your design will not allow that, and if your project can spare the cycles, you could send RS232 from a separate function that sends bits with internal time delays. It kind of depends on what your existing project will allow.
Would there be any harm to your project if occasional data bytes were lost? If not then maybe your SX could simply send a steady stream of bytes. If so then you might need to design a handshaking protocol of some sort.
David
Then the UART could stream the data to the PC.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
100 data points / second with 12 bits resolution.
Using RS232 means 10 bits to be sent serially per data byte, (one start - eight data - one stop bit). So for 100 data points, the speed is 2000 Bits/second (as you need to send two bytes for 12 bits) which is pretty low. The next faster standard baud rate is 2400 Baud. The SX can easily handle higher Baud rates than this. When you clock the SX at 50 MHz, 9600 Baud is still pretty slow (from the SX POV) but more than fast enough to handle your data throughput. So, I don't see the need for any additional hardware UART.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
Ok, so could I take this adapter[noparse]:([/noparse] www.awce.com/rs1.htm )to my breadboard and program the SX to talk to it and it to my computer?
Post Edited (BebopALot) : 3/9/2006 8:03:02 PM GMT
An adapter to shift the SXes 0/5V level to the -12/+12V RS-232 levels would be nice but not really necessary. You can find exsamples for alternative interfaces here in this forum.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
Here is a great how to schematic : (go to page 4) www.parallax.com/dl/docs/cols/nv/vol6/col/nv125.pdf with the SX28.
And if you don't want to buy the pieces individually, this URL has them pre-made to snap right into your board -www.awce.com/rs1.htm.
On the PC side of it would you use hyperterminal , c or Java - which would you use?
I said UART, not modem.
But, according to the Virtual Peripherals you could do a modem directly from an SX. It would take some more software of a different kind.
I believe the technical challenge is to get the sound reproduced in good enough quality for the telephone.
It certainly opens a different possiblity. Data sampling directly into a telephone line [noparse][[/noparse]and all in one chip].
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
http://www.sxlist.com/techref/ubicom/lib/io/dev/modem/simple_fsk_gen_1_03.SRC
http://www.sxlist.com/images/sxlist/AN7_FSK_gen.PDF
Here is a Bell-202 demodulation code (1200 bps FSK input)
http://www.sxlist.com/techref/ubicom/lib/io/dev/modem/simple_fsk_rcv_1_10.SRC
http://www.sxlist.com/images/sxlist/AN8_fsk_detect.pdf
regards peter
·
Here is another one w/o the need for a MAX-232: www.parallax.com/dl/docs/prod/schem/bs2revf.pdf.
Which program to be used on the PC side mostly depends on the format you are sending the data points. When you send pure binary values from 00000000 00000000 up to 00000011 11111111, most terminal programs will have trouble as they interpret incoming data as coded characters, e.g. ASCII chars. You might use a terminal program to capture the incoming data into a file that you can read and interpret later with a program you would have to write. Maybe, you use VB to write an application that also handles capturing the incoming data because the MSComm object that comes with VB is pretty nice to handle.
All what I'm saying here is kinda guesswork because you did not post any information about the format of the data points you are going to handle - this makes it difficult to give you a good hint.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
Kramer - you are a funny dude. I guess I did say "modem" which is technically that which you would use for a telephone. I know you will be really surprised to hear I really don't plan to do that, so I must admit my error in imprecise language!
BBAL