Device identification
leshea2
Posts: 83
Is there a way that you can tell the stamp what kind of device it will be communicating with ?
For an example, if I was using the BS2sx to send some data to a device so that the device would take the data as a command, could I pre-program the stamp to already know what kind of device it will be sending this data to, (a LCD, cell phone, etc), ?
Thanks !
For an example, if I was using the BS2sx to send some data to a device so that the device would take the data as a command, could I pre-program the stamp to already know what kind of device it will be sending this data to, (a LCD, cell phone, etc), ?
Thanks !
Comments
If YOU are writing the program then of course you can tell the BASIC Stamp what it's talking to -- in fact, you have to in order to write code that works.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I have a feeling you're asking your question in a bit of an awkward manner. I suspect what you're trying to ask is the following:
Is there a way for a Stamp to interrogate a device connected to it, so that it can ascertain what kind of device it is, so it will know how to handle it?
Neither the Stamp, nor any microprocessor I'm aware of has any device enumerartion facilities. Device enumeration is the process of investigating and interrogating every possble I/O port on the computer, and attempting to determine the following:
1. Is there a device present on the port.
2. If a device exists, what kind of device is it?
3. If a device exists, is it one for which a driver is presently available on this computer?
4. If the driver doesn't exist, can it be obtained?
5. If the driver can be loaded, interrogate the device further via the driver.
6. As a result of that interrogation, determine if the device is ready and available.
There is actually more to it than that, but those are the basics. As you can imagine it takes a good deal of computer "horsepower" to do all that, as well as a fair amount of disk storage to contain all the software drivers. In fact, real device enumeration only came about with Microsoft Windows when Windows 95 appeared, and even then it was limited. Device enumeration essentially came about when Plug-and-Play devices became more readily available. Only true Plug-and-Play devices can be interrogated, and have their status fully determined.
Regards,
Bruce Bates
Post Edited (Bruce Bates) : 10/5/2005 11:20:03 PM GMT
' {$STAMP BS2sx}
' {$PBASIC 2.5}
Sout PIN 0
Baud CON 17405
eePntr VAR Word
char VAR Byte
Msg1 DATA "Call 18004459889 at 4:35 p.m.", 0
Main:
eePntr = Msg1
GOSUB Send_Msg
END
Send_Msg:
DO
READ eePntr, char
eePntr = eePntr + 1
IF (char = 0) THEN EXIT
SEROUT Sout, Baud, [noparse][[/noparse]char]
LOOP
RETURN
END
How would I tell the stamp in a code, what it is talking to ?
Thanks !
Sometimes I have a question and at the time I can't quite put it into words the right way, so it's clear, you know.
Just trying to find out what it is you really are asking (again, if Bruce did not·interpret it already....)...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
Post Edited (Tom Walker) : 10/7/2005 3:06:42 PM GMT
But Bruce basically cleared it up for me.
Thanks !
Post Edited (leshea2) : 10/6/2005 7:25:10 PM GMT
My searches have produced lots of code but without understanding the task is a long haul. In my case I have had to marry an Elec & Eltek 2X16 line LCD with a Picaxe back pack to BS2 on a Board of Education. It refused to do anything untill, in despartion, I loaded all the code I could find untill it started to run. It is now a little confused as to what type of connection it has with the BS2. It then reverted to plain dum after it cooled down over night.
After some more fiddling with the [noparse][[/noparse]$] codes it works OK but it would have been nice to have been able to get there by design rather than by accident.
So, Jon the question about what kind of device the stamp is talking to is not a trick. There is a gap between what the designers of the bits know and what they tell the users. Getting help to bridge that gap is where the trick is.
Thank Alex.
To give you an example, I just completed a serial inkjet printer driver using the SX and our SX/B compiler. Do you think HP had ready-to-run SX code? No -- they were asking us to provide that. So, after several hours of studying the print-head documentation I was able to write a successful program. I was given no code to start with; I did it from scratch using the technical documentation on the print-head (the device) and my knowledge of programming the SX in SX/B. You can see the project (with pictures) in the SX forum.
The information we need is available -- I disagree (in most cases) that there is any gap between what designers know and what users could know (if they would just read before posting questions in a forum).
I don't mean to be harsh; I'm simply trying to be real.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
The key words are "understanding" and "information". You have them and I do not so it only looks silly until I tell you what I do not have. In effect I am colour blind until understanding is achieved. I am sorry if you thought I was being unhelpful but when you live near the bottom of the world technical manuals do not reach here very often and unless you know the name and ISBN number they remain unobtainable. Without the correct key words internet searches are not always helpful either, until one understands how the author thinks.
So if you are able to help?
1. Do you have a complete instruction set for the BS2 or can you direct me to its location?
2. Are you able to direct me to the complete instruct set for the Elec & Eltek 2 x 16 LCD with a Picaxe CTR19K 0511 code AXE033 v2(c)01-04 with a pic16f819-I/P 04413BG chip.
My attemps to obtain this information have been unsuccessful and may explain some of the frustration.
Thanks Alex.
·· Complete help for all BASIC Stamp command is available in the Stamp Editor help files, along with example codes for most of them.· You can also download the complete BASIC Stamp Reference and Syntax Manual from the following page (Toward the bottom) in PDF format.· As for your LCD, it looks like it has a custom micro backpack, and you would need to find out the commands for it.· Perhaps from the manufacturer?
http://www.parallax.com/detail.asp?product_id=27218
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Professor Peter Anderson has quite a bit of PICAXE material, and links to other sites that deal with the PICAXE, on his site. Try :
http://www.phanderson.com/picaxe/picaxe.html
Specifically, he has a few PICAXE LCD controllers, and the instruction sets for same at:
http://www.phanderson.com/lcd106/lcd108.html
I'm not sure if this is what you need, but it may be a place to start.
peter
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Peter C. Charles
Director, Research and Technology
CyberBiota, Incorporated
Peter.charles@cyberbiota.com
http://www.cyberbiota.com
Down loads done and reading underway.
Thanks Alex
One of the most valuable tools in our collective arsenal is the Internet search engine. Google happens to be my favorite, and there are other good ones. Learning to use them effectively will probably help ameliorate some of your frustrations, and help you get to the actual work of your project more quickly.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax