View previous topic :: View next topic |
Author |
Message |
rileyesi
Joined: 19 Dec 2006 Posts: 398
|
Posted: Thu Jan 15, 2009 8:38 pm Post subject: Help make a simulated signal source |
|
|
Hi,
I have a system that reads analog voltages, does some math, and sends out data packets using the hardware USART on a Mega8 chip. I then receive that data (again, using a Mega8), decode the serial information, and put out an analog voltage using a DAC. The receiver and transmitter are miles apart.
One site is having a problem. Unfortunately, when I designed the system, I was not wise enough to use indicating LEDs to show when the reciever was actually receiving data. So, my customer is having a hard time trouble shooting a system that is suddenly not working.
Lastly, the system is several thousand miles from me!
What I would like to do is to get/write a simple program that I could e-mail to him that would generate some "test pattern" data packet on a computer that could be connected to the receiver. That would allow the PC to act a the transmitter giving predictable data. That way, they could further isolate where the problem is.
However, I have very little experience writing programs for a PC.
If I wanted to write a program that would simply send 17 ASCII characters through the serial port once per second, where should I start looking (Visual BASIC??)
Also, he may only have a lap top to work with that may not have a serial port. Are there USB to serial (i.e. DB-9) converters?
As always, thanks.
Pete |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Thu Jan 15, 2009 10:21 pm Post subject: |
|
|
VB would certainly do that, but you could do it without any programming, just using Hyperterminal, supplied with every Windoze. Write the characters into a text file as a line using a text editor ( eg notepad ). Repeat as many lines as you want. Set Hyperterm up to the right port, baud rate, in the Connection Properties select ASCII setup, line delay 1000 msec. Save the configuration ( a .ht file ) to send to customer. Then he sends the text file using Transfer | Send Text, after opening HT with that config file.
USB <> Serial port dongles are freely available. Most of them work. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
rileyesi
Joined: 19 Dec 2006 Posts: 398
|
Posted: Thu Jan 15, 2009 11:09 pm Post subject: |
|
|
Adrian,
Thanks for the reply.
Another wrinkle. I don't want to rely on the guy's typing skills to trouble shoot the system. I would rather have a program that will automatically send the data.
If VB is the way to go, is there a cheap/free compiler available that you can recommend? A quick google search resulted in 1.1 million hits! Kinda hoping someone can narrow that down just a bit!
Thanks,
Pete |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Fri Jan 16, 2009 12:02 am Post subject: |
|
|
If you use Hyperterminal, you supply the text file and the .ht config file. Your customer has to learn enough to send the file.
VB is now VBNet, which IMHO is awful, almost impossible to do just quick and dirty programming. And needs the .NET framework installed, 20+ Mb of junk. Even VB5 or 6 still needs a runtime library installed. And you need the program development kit, which is a big learning curve if you never used it before.
Has the customer got any recent MS Office components like Excel or Word etc installed. In which case he has VBA, and you can can write an app for that, and run it.
I dont know any easy, simple language which will run on a modern machine without lots of stuff to install to get it to go. I suppose QBasic is still buried in there somewhere, but XP would probably barf at a direct port write.
I know it seems crazy, I could write such a thing in an hour or so, but I already have all the tools. Starting from scratch could take you a week. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Fri Jan 16, 2009 12:08 am Post subject: |
|
|
Just one further thought, although it might mean you have to send some hardware. Why not program up one of your existing AVR modules to send a fixed data stream, and give him that as a test unit ?
Can you even change the program in one of his unit to do this ? Have you got a facility to upload a program to a remote unit ? _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
rileyesi
Joined: 19 Dec 2006 Posts: 398
|
Posted: Fri Jan 16, 2009 2:21 am Post subject: |
|
|
Adrian,
I thought about sending the hardware, but I was trying to save some money and (more importantly) time. Also, I am pretty sure that it is not a problem with my equipment, but the phone system they are using that carries my signal. In my gut, I hate throwing money at a problem that is not my fault!
E-mailling a program that he could run on his PC seemed like a good idea.
I will persue your other ideas using hyperterminal.
Thanks, again. The generosity of this forum (and you are one of the MOST gulity!) never ceases to amaze me.
Pete |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Fri Jan 16, 2009 2:43 am Post subject: |
|
|
Agreed, problem may not be your fault. But I learned a long time ago that transmitting data over uncontrolled lines needs error checking about 20 different ways, and even then it can give you grief. Murphy Rules ! _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
rileyesi
Joined: 19 Dec 2006 Posts: 398
|
Posted: Fri Jan 16, 2009 2:55 am Post subject: |
|
|
Hi,
I agree. Unfortunately, I only can control what I shipped!
I tried to get smarter on hyperterminal and found that it is no longer in use with Vista! I was directed to Telnet, which seems to be a method of connecting PCs over the internet.
The quest continues!
Pete |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Fri Jan 16, 2009 3:31 am Post subject: |
|
|
Vista yuck !
There must ( ought ??? ) to be a terminal program that is in Vista. Else you should be able to at least install HT or something in Vista. HT is actually not that good, I only suggest it because its on all Windoze machines ( pre Vista ). Have look on Sourceforge for Realterm, which is what I use normally, although its more of a debugging terminal tool. But it also allows to upload files, and send ASCII string sequences direct from the display. Not sure about timing the output to 1 per sec. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
mattcro
Joined: 03 Oct 2007 Posts: 327 Location: Scotland
|
Posted: Fri Jan 16, 2009 6:58 pm Post subject: |
|
|
For something more akin to Hyperterminal (but more useful), try TeraTerm. I use this a bit for sending text files and XMODEM transfers, and general terminal work. It can be configured from a text file (a bit like Hyperterminal's .HT file) and you can specify inter-character and inter-line delays. It's overkill for something this simple and now comes with a bunch of extra stuff (SSH etc) that I don't bother to install, but is one of the better free terminal utilities I've tried (though I've not tried it on Vista). _________________ If all else fails, read the manual. Even better: read the manual before something fails. If you can't find it in the manual, search the forum.
BascomAVR 2.0.8.5 |
|
Back to top |
|
|
rileyesi
Joined: 19 Dec 2006 Posts: 398
|
Posted: Fri Jan 16, 2009 9:16 pm Post subject: |
|
|
Hi,
As a follow up...
I decided to send him some hardware with a "test pattern" broadcast.
To Mattcro,
Thanks for the link. I'll look into TeraTerm for curiosity sake!
Thanks.
Pete |
|
Back to top |
|
|
|