Full Duplex Serial Plus -- Memory Storage Management
Hello! It has been a while since I have had the pleasure to develop with my propeller, I am still fairly green so these may be basic questions please go easy.....
1. Full Duplex Serial Plus Object--I am trying to receive a 6digit decimal value for some reason it keeps truncing anything over 5 digits or dec value of 65535. I am assuming that the buffer size is the issue i see the [16] where the variable size is declared. Is this the size of the buffer? If so why can't i make it larger? If i can how do i do this?
**************I figured number one out, I told you guys it had been a while...the variable I was using to store the value was declared as a WORD! So it makes sense that the value of the ID was limited to 65535*********************************
2. Can i use the Memory Storage Management Obj to store data on the prop EEPROM? I only need to store approx 50 to 75 6 digit numbers. I need to compare them to the RFID value the a card or FOB id presented.
This is solved. I used the propeller EEPROM object. Thanks for the feedback!
If there is an easier way I am all ears...... I am going to go back through the PE kit tonight and brush up.
Thanks.
1. Full Duplex Serial Plus Object--I am trying to receive a 6digit decimal value for some reason it keeps truncing anything over 5 digits or dec value of 65535. I am assuming that the buffer size is the issue i see the [16] where the variable size is declared. Is this the size of the buffer? If so why can't i make it larger? If i can how do i do this?
**************I figured number one out, I told you guys it had been a while...the variable I was using to store the value was declared as a WORD! So it makes sense that the value of the ID was limited to 65535*********************************
2. Can i use the Memory Storage Management Obj to store data on the prop EEPROM? I only need to store approx 50 to 75 6 digit numbers. I need to compare them to the RFID value the a card or FOB id presented.
This is solved. I used the propeller EEPROM object. Thanks for the feedback!
If there is an easier way I am all ears...... I am going to go back through the PE kit tonight and brush up.
Thanks.

Comments
Can i just say that if you had a Forth running that this would be such a trivial matter and that it would take longer to ask than it would take to write and test.
What is Forth? I will follow your link.
Can you describe Forth is 25 words or less? Or maybe a few more?
But what is it all about?
I am actually using an RFID reader from RFIDEAS it is the PC prox, it is sending the data in decimal format I have set up the reader to send only the Card ID number and a CR. The id numbers are 5 to 6 digits long.
I would be interested in learning a little about FORTH I went to your website and it looks quite interesting. The project is pretty basic.
1. Enroll Cards- I plan to have a jumper on the board to trigger a method that will save all ID's which are scaned to a list of approved cards.
2. Read Cards-Each card that is presented to the reader will be read and have it's ID compared with the enrollment list. If approved go to step 3....
3. Send output to close relay which will bypass--or simulate--the pressing of the switch on the garage door opener that we use to control the gate to access the facility.
4. I will probably integrate some LEDs for good and bad scans or non authorized cards etc.
I loaded TACHYON on my prop chip and I am following your tutorial on the link you provided. I am using the Prop Serial Tool, each time I press the space bar it acts like I enter the CR key and replies with ???, I wonder if this is an issue with the TERM or what?
If you are using Windows then try the open-source TeraTerm, it's really good. On LInux I am using Miniterm. But yes there is a problem with your terminal by the sounds of it though I have never used this software.
You know that you can use an indicator LED as a "button". Also you could have a "master" card which is always recognized and toggles the enrolment mode or in combination with a "button" or two then also removes certain cards. But that sounds like a very primitive way to do it as I would just have one of my Bluetooth serial modules embedded with the Prop and communicate to the unit via a laptop or tablet or phone to program and configure it.
While over on the "Spin Improvements" thread they are arguing about whether we should even have a language (in this case spin) that doesn't have a MAKE file, OMG. And here Peter is gonna start a FORTH riot by acutally helping people in the trenches get'r done.
Good on you Peter. 25 words, kinda verbose for you isn't it :-/
Here is a far more verbose version I wrote while munching my bagel and sipping my espresso, but it's a complete ready to go turn-key solution. When I get some time I will load it in and check it out with the Parallax RFID reader.
[FONT=courier new]TACHYON { Demonstrate how a RFID card reader can be implemented to enroll cards and to check access. When the enroll switch input is high all cards will be added to the card table and backed up to EEPROM The relay will also energize for 1 second When the enroll switch input is low then all cards will be checked against the card table and if found then the relay will be energized for 1 second. The program can be expanded very easily to output to an LCD or simple indicator LEDs and also a piezo } #P0 CONSTANT #rfid \ RFID serial input on P0 #P1 CONSTANT #enroll \ Mode switch to select enrollment mode #P16 CONSTANT #relay \ A relay is connected via a suitable driver #P17 CONSTANT #beeper \ An optiona piezo or speaker or LED may be attached to this pin #1000 CONSTANT cardlimit HERE $3F + $3F ANDN 1- here W! \ Align \ Create a table of longs for cards in RAM but backed up in EEPROM TABLE cards cardlimit 4 * ALLOT cards cardlimit 4 * ERASE \ Index into the card enrollment table and return with a physical address of a long pub CARD ( index -- addr ) 2* 2* cards + ; pub CARD? ( card# -- index flg ) FALSE cardlimit 0 DO OVER I CARD @ = IF 2DROP I TRUE LEAVE THEN LOOP ; pub ENROLLED? ( card# -- flg ) CARD? NIP ; \ Find the card in the table and if found then wipe it pub REMOVE ( card# -- ) CARD? IF 0 OVER CARD ! THEN DROP ; \ Find a null entry in the card table and write the card# to it. Return with a success flag unless table is full. pub ENROLL ( card# -- flg ) cardlimit 0 DO I CARD @ 0= IF I CARD ! 0 LEAVE THEN LOOP 0= ; \ Enroll a card if it is not already enrolled but if it is then remove it pub EDIT ( card# -- flg ) DUP ENROLLED? IF REMOVE FALSE ELSE ENROLL THEN ; \ Backup the cards table into EEPROM - automatically loaded on power-up with the rest of the program pub SAVE cards DUP cardlimit 4 * ESAVE ; \ Turn the relay on or off pub RELAY ( on/off -- ) #relay PIN! ; \ RFID serial input routine pub RFID #rfid SERIN ; pub BEEP #beeper APIN #2500 HZ #100 ms MUTE ; pub BEEPS ( cnt -- ) FOR BEEP #200 ms NEXT ; pub MAIN #2400 SERBAUD \ Setuo baud rate for RFID reader \ ' RFID ukey W! \ assign input vector used to input serial stream (comment out to test from console input) 2 BEEPS \ Let's just beep because we can to say we're ready DECIMAL BEGIN GETWORD NUMBER \ Read a word from the input and convert to a number ( number digits ) IF #enroll PIN@ \ Read the state of the enroll mode port pin IF EDIT SAVE ELSE ENROLLED? THEN DUP IF BEEP ELSE 3 BEEPS THEN \ Single beep to indicate success otherwise beep beep beep RELAY 1 second OFF RELAY \ If a true flag has been returned then this will turn on the relay for 1 second THEN AGAIN ; \ Instruct Tachyon to run MAIN automatically on startup and backup the program and settings into EEPROM \ AUTORUN MAIN BACKUP END[/FONT][FONT=courier new] [/FONT]EDIT: I have just tested this out using the normal console serial input and outputting the beep and relay to the demo board's LEDs. Works like a charm. Uncomment the 2nd line of MAIN if you want to do the final test with a RFID reader.
Are you running Tachyon SRLM? Inquiring minds want to know. Would be nice to see you join the FORTH wrecking crew.
dp
Dave,
I will post the code as soon as I get it organized, I am not a programmer so I tend to use alot of the demos and modify them for my projects. Currently I have been testing this in a very unorganized way and I would be embarrased to post what I have.
Thanks for the Offer.
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 card_array_size = 10 OBJ pst : "Parallax Serial Terminal" Mem : "Memory_Store" VAR 'long RFIDCODE [10] WORD INDEX WORD INDEX1 LONG COMMAND WORD NBR long test123 long RFIDCODE [card_array_size] PUB TwoWayCom | value pst.Start(115_200) pst.Clear mem.init {RFIDCODE[0] := RFIDCODE_ARRAY[0] This was a test of some values. RFIDCODE[1] := RFIDCODE_ARRAY[1] RFIDCODE[2] := RFIDCODE_ARRAY[2] RFIDCODE[3] := RFIDCODE_ARRAY[3] RFIDCODE[4] := RFIDCODE_ARRAY[4] RFIDCODE[5] := RFIDCODE_ARRAY[5] RFIDCODE[6] := RFIDCODE_ARRAY[6] RFIDCODE[7] := RFIDCODE_ARRAY[7] RFIDCODE[8] := RFIDCODE_ARRAY[8] RFIDCODE[9] := RFIDCODE_ARRAY[9]} repeat pst.Str(String("Enter a decimal value: ")) 'this section is for my commands to manage the app. VALUE := pst.decin 'Entering 45 displays the status of the array slots IF value == 45 '46 starts the enroll process for now it type the SLOTCHK 'values in on the PST term instead of scanning If value == 46 enroll REPEAT INDEX FROM 9 TO 0 'this section compares the scan with the array IF VALUE == RFIDCODE[INDEX] 'eventually it will activate the relay when i get that far... pst.Str(String(pst#NL, "rfid FOUND-->")) PST.DEC(RFIDCODE[INDEX]) INDEX := 0 {ELSE pst.Str(String(pst#NL, "NO VALUE FOUND-->")) PST.DEC(RFIDCODE[INDEX]) PST.NEWLINE PST.DEC(INDEX)} repeat 2 pst.NewLine PUB SLOTCHK REPEAT NBR FROM 0 TO 9 IF RFIDCODE[nbr] == 0 PST.STR(STRING(PST#NL,"SLOT # ")) PST.DEC(nbr) PST.STR(STRING(" EMPTY")) ELSE PST.STR(STRING(PST#NL,"SLOT # ")) PST.DEC(NBR) PST.STR(STRING("**FULL**-->")) PST.DEC(RFIDCODE[NBR]) PUB enroll | start, limit ,valu pst.Str(String("Enter Slot Start: ")) start := pst.DecIn pst.Str(String("Enter Number to Enroll ")) limit := pst.DecIn REPEAT INDEX1 FROM start TO limit pst.Str(String("Scan Card: ")) valu := pst.DecIn RFIDCODE[INDEX1] := Valu pst.Str(String(pst#NL, "RFID:--> ")) pst.Dec(INDEX1) pst.newlineI'm not familiar with the Memory_Store object, so I can't really comment on how that works. I usually use the basic_i2c_driver object to do what you want to do. What I would do is create an array of your stored values in a DAT section, and then overwrite their locations in the EPROM image to save them. This way you don't even have to explicitly read them from EEPROM. The values will just be there when you boot from EEPROM.
Thanks Dave, I'll have a look at the basic_i2c_driver object and see if I can make it work. I appreicate the help!
Have a great weekend.
Josh
I actually plan on loading the code that you posted. I am interested in learning about Forth. I wanted to figure out the issues I had with spin first. A lot of what I do is to satisfy my hunger for knowledge and to learn about different technology etc.