Shop OBEX P1 Docs P2 Docs Learn Events
SAR type registers and the Stamp 2 — Parallax Forums

SAR type registers and the Stamp 2

Hello!
For those of us who aren't familiar with this class of shift register, they were first created a rather long time earlier. One pair are the Mc1454549B and the Mc145559B types, originally made by Motorola, who make the ones I have. They are typically used to support digital to analog and of course analog to digital converters. However I have gotten this one, the Mc145459B to work with the Stamp2 using the SHIFTOUT instruction. Example here:

' {$STAMP BS2}
' {$PBASIC 2.0}

serdata  VAR  Byte
again:
'*****this will wait for serial from calculator
SERIN 15,396,[serdata]

'***this will send it to the pc debug screen
DEBUG DEC serdata, CR


'***this will send the same data plus 1 back to the calculator
serdata=serdata + 1
SEROUT 15,396,[serdata]
SHIFTOUT 0,1, MSBFIRST, [serData]
'SEROUT 12,396,[serdata]
SEROUT 15,396,[serdata]
SEROUT 14,396, [DEC serdata, CR]
serdata=serdata + 1
PAUSE 4
'SEROUT 14,84, [DEC serdata, CR]
serdata=serdata + 1
PAUSE 4
GOTO again

The code comes from the one for the TI83Plus that first surfaced during the days of discussing everything on the (late) Yahoogroups platform. Including the SHIFTOUT instruction as shown there,

SHIFTOUT 0,1, MSBFIRST, [serData]

took some doing. Originally the entire program was aimed towards the regular families of eight and four bit shift registers. But it just works on this SAR type one.
I will now allow for a discussion on why that part was chosen, instead of the other one, or any of the still available part numbers.
Curious mascots only were involved in this drafting.
Also AI is allowed for investigating the part numbers, this leaves out Chat GPT and a few others, people may use the one from Google however, as it does have the sterling qualities attributed to two other examples.

Sign In or Register to comment.