Stamp Timing Puzzle
Humanoido
Posts: 5,770
The stamp BS1 can only do one thing at a time. Each of 10 stamps need to report their ID number (using serout), while the others listen (using serin) and write all the numbers to eeprom. Each stamp does not know the other stamps. The ID numbers are approximately 0, 17, 28, 40, 49, 70, 89, 111, 116, 128.
I was thinking about some internal timer, and each computer talks in their time slot, and listens in the remaining time slots. Is there anything internal to the BS1 that can be read as a timing tick, while the program is running? I really don't have the resources to add ten clock chips although that would be a perfect solution.
Maybe there is a much more simple solution?
humanoido
I was thinking about some internal timer, and each computer talks in their time slot, and listens in the remaining time slots. Is there anything internal to the BS1 that can be read as a timing tick, while the program is running? I really don't have the resources to add ten clock chips although that would be a perfect solution.
Maybe there is a much more simple solution?
humanoido
slot 1 2 3 4 5 6 7 8 9 10 id 0 17 28 40 49 70 89 111 116 128 bs1 x bs2 x bs3 x bs4 x bs5 x bs6 x bs7 x bs8 x bs9 x bs10 x
Comments
I had a similar problem, I needed a common "timer service" on my serial bus.
I set up a Javelin as a timer master. From my stamps I send "resettimer(x)" and "gettimer(x)" via SEROUT to the Javelin, which responds with elapsed time.
Currently I have three timers going, but you could in principle have unlimited numer of timers, with the Timer() object .
This is great because it allows me to have "virtual" timers going while I do my Stamp processing.
It might not suit your needs, but I thought I'd tell you anyway.
--
dev/null
Thanks for the idea. I will create a fuzzy timer, set and controlled by the absolute computer. A precise timer is not necessary so a virtual fuzzy clock will work just fine. No parts necessary. The key here is not to poll the VR Clock but rather have the clock controller send out flags. Sort of like tuning your radio to WWV and listening for the incremental mark.
humanoido
This solution would work if the other stamps can be programmed with the IDs of the other stamps on the line, then have them go in sequence like this:
STARTLOOP:
SERIN ID, data
WRITE ID, data to eeprom
if ID = target ID THEN TRANSMIT
GOTO STARTLOOP
TRANSMIT:
pause 1
serout ID, data
goto STARTLOOP
Each stamp has a target ID, which is the ID of one of the other stamps. Also, instead of a target ID, you could just use a range.
Hope that helps,
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
---
dev/null.