RS232 between PC and embedded MPU

What is the best method to have a PC and embedded MPU communicate with RS232? I have a HC08 that doesn't have SCI, so it would all have to be in software. There are probably ROM routines that would help but I haven't been able to find any documentation on them. This seems like it should be a "cut and paste" job. Maybe I have to code it myself.

On the PC side I was thinking of using Visual Basic, thinking that would be the easiest.

I already have the IDE up and running - so I don't need it for debug, or programming. I am trying to get a stand-alone data collection project running with an embedded MPU and a PC. The PC would receive the data, save, and graph it.

Does anyone have any experience in this? Thanks.

Reply to
js1180
Loading thread data ...

I don't know much about software UARTs. You could try a hardware UART on the SPI bus. The external UART will require an appropriate crystal to generate the clock signal.

-- Arya

Reply to
arya

I have absolutely no experience in the HC08 but plenty in Google. This link seems to cover what you want.

formatting link

Peter

Reply to
Peter

Java is pretty easy, just download the javas.comm package from sun. Its a sinch to use java and RS232 interface.

--

Wing Wong.
Webpage: http://wing.ucc.asn.au
Reply to
Wing Fong Wong

with

be in

haven't been

a "cut

would be

or

save,

Have you looked at HyperTerminal? It's already on the PC and has proven adaptable for creating data files of the sort you seem to be describing for many of the simple test beds I've set up.

Regards, Ken Asbury

Reply to
avoidingspam2001

there are some appnotes describing different approaches, e.g. using a hardware timer (interrupt).

[...]

VB doesn't support the serial interface nicely, but you can use rsapi from Berndt and Kainka.

If you want to do it in "plain C" and Win32, there will be soon a simple but powerful open source solution ("serialapi") in sf.net.

Contact Andi Martin or me if you need it earlier.

Oliver

--
Oliver Betz, Muenchen (oliverbetz.de)
Reply to
Oliver Betz

Using a serial port in Python is dead simple using the pyserial module. If you want to get fancy, it's not all that hard to use the native Win32 File API so you can do async stuff.

--
Grant Edwards                   grante             Yow!  I'm rated PG-34!!
                                  at               
                               visi.com
Reply to
Grant Edwards

If this is roll-your-own then the easiest is to drop windows and run under DOS

-- boot dos, not the dos-box in windows, though the dos-box did work on Windows

  1. Next is non-visual C and a communications library.

I have never tried doing data logging / instrument control with Visual-xx or NET, so maybe that is, after all is said and done, the best choice.

-- Nicholas O. Lindan, Cleveland, Ohio Consulting Engineer: Electronics; Informatics; Photonics. To reply, remove spaces: n o lindan at ix . netcom . com psst.. want to buy an f-stop timer? nolindan.com/da/fstop/

Reply to
Nicholas O. Lindan

be

DOS

Windows

or

Heck, you can run just fine in a DOS box under Win95, Win98, and Win2k. I've done it without problems on all of these. Use an interrupt handler under Win9x, and just poll under Win2k. Win2k handles the I/O to the port, and supplies buffering, so you don't need to do it for that OS. If you want to, you can sort of detect the OS running from DOS, by using some Win9x int calls. Alas, Win2k detects as if Windows is not running, but once you know that it's not a problem.

Hope this helps,

Mike Anton

Reply to
Telus

On the PC side, if you want VB or VBA/Excel code, drop me a line. I have two examples that I can send you. One is VB6, the other is Excel with VBA. Both use the MSComm control. I've used both of these for what you are interested in doing.

Sorry can't help you with the HC08, but code should be available searching google. I've done bit-banging on the PIC. Select a UART to handle the voltage adjustments. Make sure you put a jmp on the board so you can loopback the UART. This makes it easy to test using an "echo" type test with the jumper in place across RX/TX. If you are using "C", implement it in "C", then extract the assembler and hand code it to get the timing right.

snipped-for-privacy@yahoo.com >What is the best method to have a PC and embedded MPU communicate with

Reply to
AntiSPAM_g9u5dd43

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.