Serial communication
I want to use a BS2(p) to activate a pager system used for a emergency system by means of serial communication
Can anyone tell me wich baudmode to use for· 9600 8O(dd)1 ?
·
Can anyone tell me wich baudmode to use for· 9600 8O(dd)1 ?
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
With STAMPs, Parity is only possible with 7-bit, and then it's Even Parity only. (Odd Parity not supported.)
Update -- I wrote an SX/B program to transmit 8-bit Even Parity.· To modity it for Odd parity transmission would be a snap.
Post Edited (PJ Allen) : 9/21/2007 10:06:41 PM GMT
Thanks for your reactions
Jan
From the Netherlands
-Phil
You'd need to fill in the rest, but you get the idea ... add $80 to the value if there's an even # bits.
You would put your messages into EEPROM with a DATA statement, then use a subroutine to transmit them.
You could hand translate the codes into odd parity as well and use them directly in SEROUT statements.
Note that you'd need a special subroutine to send numbers (like the DEC formatter).
Lance
I went ahead and completed the full table....or at least I think I did
Mike, can you check that I did it right and if not, let me know?
Thanks,
Lance
I have a question. Now that I'm trying out the code sample I'm getting an error at this line:
It's calling "table" an undefined symbol.
I'm sorry if I'm asking stupid questions, but these are all aspects that are new to me and I have my manual sitting on my lap as I type.
I think I understand the concept of your code, but must be missing something on the execution. Let me write it in plain english to see if I got it right, then maybe we can find out what I'm missing.
Basically, we're reading in the parity table, then the message command. We're reading the first character ("a") of the message which translates to ASCII code 97 (hex code $61). We're then reading memory map position 97 ($61) to find out the actual command to send. In this case $61. $61 is 1100001 so it doesn't need to be converted before being sent.
We're then sending that data to the SEROUT pin.
Did I miss something?
Thanks,
Lance
You've got the idea right.
Read the chapters in the PBasic Manual on the DATA and READ statements. They explain how the DATA statement values get stored in EEPROM memory and how you use READ (and WRITE) to access these table areas.
Sorry, one more question then I'm going to take a break on this project.
I'm using a BS2 and communication 9600 baud. If I'm understanding correctly I need to send the code in 8-bit, no-parity, true which would give a {baud} code of 84. Is that right?
If so, I'm doing something wrong and its getting frustrating. I've gone so far as to manually send the 4 codes to initialize my device and it's not working. When I switch to a dedicated terminal it goes ok. I don't get it.
Lance
If you're using the programming/DEBUG port on the Board of Education, that has other considerations.
I guess that's what I get for using my BOE instead of my Pro Dev Board. I've got a BS2pe which I will try using tomorrow. Thanks again for the help. I'll (hopefully) let you know how it goes.
Lance