PC Status Indicator Using Basic Stamp BS2
Peter Savory
Posts: 5
I am new to the Basic Stamp, I am trying to use the Basic Stamp to operate out puts to control lights which will show the status of the PC that the Stamp is connected to.
1 - Output when the PC is in stand by mode and ready to receive data.
2 - Output when the PC is traferring data or recieving data.
3 - Output if there was an error transferring data or if there is a problem with the PC.
Can any one help, I have not got a clue.
1 - Output when the PC is in stand by mode and ready to receive data.
2 - Output when the PC is traferring data or recieving data.
3 - Output if there was an error transferring data or if there is a problem with the PC.
Can any one help, I have not got a clue.
Comments
Hi Mike, the scenario is, a Truck with a lot of data on board checking all operations of the truck, when the truck parks in its parking bay it will transfere data either wirelessly or via a plug in cable to a PC, the PC will have software that will recive all data from the truck to preform diognostics to make sure all parts on the truck is operating correctly.
The truck driver needs to see some illumination of lights to indicate that the PC is ready to recieve the data, that the data has transmitted from the truck to the PC ok or if there was a fault with the transmission from the truck to the PC.
Using Basic Stamp I need to create an interface between the PC and the illumination of lights, the lights will be switch via relays but I need to get the signals from the PC to operate the relays note sure of correct terminology but switching the lights to different colours to illustrate the status of the PC is the final outcome.
For example, assuming this is a standard RS232 serial port, you could build a simple interface to receive and transmit data signals that indicates whether data is being transferred. A 22K resistor between a Stamp I/O pin and the signal may be enough as shown in the Stamp Manual chapter on the SERIN statement. An RS232 line typically idles at a negative voltage (-3V to -15V) to indicate a one bit and changes to positive to indicate a zero bit (+3V to +15V). The Stamp could monitor the data line for a short period of time looking for pulses. If there are any, there's data going back and forth.
On the other hand, for a Stamp to determine that there are errors, it has to look at the data itself and know what should be there or the PC has to tell it that an error occurred. That may be too complex and require too much speed from the Stamp ... depending on the details not yet described.
If the PC uses a standard serial port and uses the DTR / DSR and RTS / CTS control lines, the Stamp can monitor them to find out if the PC is indicating that it's ready to receive data. That's a function of the way the PC program uses the serial port.
For reliability, the PC would probably send each character twice with a 20ms pause between characters.
2) The starting point for Stamp programming is "What's a Microcontroller?" (here) and "Basic Stamp Syntax and Reference Manual" (here). Both (like most of Parallax's documentation) are downloadable for free and available in book form. If you need to drive a relay or an incandescent bulb from a Stamp I/O pin, look at Nuts and Volts Column #6 (under Volume #1 here).
3) If you want more detailed help, you'll need to supply more information. Do you have a Stamp already? If so, what board are you using? How many indicator lights do you need? What kind are they (LED or incandescent)? What voltage and current do they require?
The operation is not to operate the lights but to give output voltage when the condition are met, I will interface relays to control the lights, voltage is not an issue.
LED's can be connected to the bread board to demonstrate that the unit is operating when the PC changes status.
I have never delt with this type circuits so not sure where to start.
We have the Basic Stamp 2 module microcontroller & the Board of Education USB development board.
IF theChar = "A" THEN HIGH 5
The last statement would be a GOTO to start it all over again.
Go through "What's a Microcontroller?" and the Reference Manual to see what else you need in the way of declarations, compiler directives, labels, etc. It's all there and you need to learn it. There are plenty of simple examples of what you need.