CODE .... How to Serial in TTL 8-N-1 ???
Jeff_5_
Posts: 36
I have an rfid reader that is reading my tag and im trying to input it in to my Basic stamp. The code of the Tag is 1nKq101 with the last one being a space character. I was told the data is in the form of 8-N-1 TTL non inverted output.. My question is what kind of code do i need to read this in to my basic stamp and display it on the screen?
Comments
I would suggest you to post the code you are working with so we can better help you. Are you using the Parallax RFID reader and are you using the demo code that came with it?
Thats is and all im getting is 0 and 1s i think i need to convert to ASCII
This is the reader I am using
So, the Stamp should be set for INVERTED baudmode.
And you need to place a 22KΩ resistor between the
-R's output and the Stamp's input pin.
(If you use/have a MAX232 between the two then you'd set
the Stamp up for a TRUE baudmode.)
So I can get the data from the reader to the stamp with rs232? I was told it would be Easyier to get the data out in ttl form before its converted to rs232
Use DEBUG to write data to the terminal window. Please read the STAMP manual.
In the current context, this line of code, assuming you mean TagID VAR Byte... waits for the value in TagID to show up on pin 1 but TagID is not initialized so it's nothing or zero. When SERIN sees zero on pin 1 (84 is 9600 baud for a BS2) it puts whatever decimal value received on pin 1 in TagID. Now TagID is initialized with some arbitrary value and the whole thing starts over again.
If you still need help post your latest code. What kind of STAMP are you using?
I kind of understand what your saying. I am on the BS@ homework board. I want to read in the tag id and set it all in one variable
For some reason i think i need something like
TagID Var Byte(4)
SERIN 1,84,[WAIT($0A), STR TagID\4] Which is read on pin1 at baud rate 9600(84) then wait command and then read in to a string of 4 spots.
Then
Debug STR TagID
I get random symbols and i dont understand why.
I think if I were trying to use this thing, I'd write the program to monitor the receive data line in a loop looking for maybe 2 seconds of mark (1) starting the timing over if any space (0) is received. Once I found 2 seconds of uninterrupted mark, I'd know that there's about 1/2 second until the next ID is to be received. I'd start the SERIN at that point. The Stamp would hang waiting for 4 bytes to be received, and I'd know that I'm not trying to receive somewhere in the middle of an ID sequence. I'd probably receive 5 bytes and actually check for a space as the 5th byte.
? ? ?
Consistent #s?
PE --
$0A means you're waiting for a Line Feed.
Your device generates a Line Feed as the 1st character in its output series?
I don't want to read about it, but you can tell me/us about it.
Say it is.
Change it to --
With this code i get a return of four two digit numbers and letter but no more symbols.
Why do I have to pry the information from you?
Help me help you, Jeff_5_.
Participate, Contribute, Fill Your Boots, My Brother.
This is what i get after reading 3 times.
28
60
11
21
FF
00
18
30
00
84
00
00
Nothing even seem similar. Now im starting to questions the location of my data output from the reader.
one more thing i forgot to mention. The reader has an RSSI vale also. Almost like a distance meter. So the output from the read is the tag code being 1nKq the a 3 digit number and a space
Ex 1nKq103_
1nKq83__
underscores represent spaces.
You need a voltmeter --
If the data is "TTL true" then that data pin should be HI when it's idle (doing nothing), the start bit will be 0/GND.
The data out pin of the RS232 (pin_2, assuming it's female), which you ought to be using but won't, should
be some negative voltage (-5-12V) when the unit is idle.
Can you confirm?
The "ananiha" people don't provide any schematic at the link, so I don't know if they're using a level shifter or using the ol' series resistor gimmick themselves (which I hate.) If they have some means of providing a negative voltage then that pin_2 should go negative; otherwise it'll just go to 0/Gnd in the inactive state (the start bit is a negative voltage.)
Anyway, I guess we can presume that you found the TTL pin to pick off.
RF8315T -- "An unique 4 characters (A-Z, a-z, 0-9) will be sent out on every 2.5 seconds plus/minus 0.5 second. "
Maybe expanding your buffer will help you capture more info/data and thereby find what the scoop is.
Here is the result now
00
80
FF
FF
02
00
00
06
00
00
00
FF
00
00
03
08
02
FE
37
40
00
02
3F
02
00
02
00
FF
31
00
00
FC
FF
20
00
FC
i copy and pasted the copy you typed in your last reply and ran it and this is what i get. I just dont understand it should be the same every time.
Have you tried the Inverted baudmode for grins & giggles?
If that device has a female connector on it, can you plug it onto your serial extender
[PC] and get any intelligence on Hyperterminal (or other terminal program)?
SERIN 1,16468,[STR TagID\x]
(x = however many bytes in your array)
PE -- Note my corrections in #24: TTL IDLE is HI, start bit (active) is 0/GND; 232 IDLE is LO/V_neg, start bit (active) is V_pos. I'm ripping myself a new one.