DUINOMITE: TESTING NEW COMMANDS SHIFTOUT


Image

These who used Basic stamps in the past remember how useful were the SHIFTIN and SHIFTOUT commands to send and receive serial data. These commands were missing in DM-BASIC  and I was wondering how to interface our new MOD-LED8X8 stackable LED bricks. Using normal BASIC commands which execute for 32 uS each would make the output very slow, so I wrote on KSD forum – I need desperately SHIFTIN/SHFTOUT commands :).

Ken is busy right now with the USB host implemetation so Keyboards, Mouses and USB memory sticks to be implemeted in DM-BASIC so I was not expecting that he will have time soon to work on this, but for my nice surprise Iggy from the forum said I will try to implement this over the evening.

Today he sent me DuinoMite.HEX with SHIFTOUT command with this syntax:

SHIFTOUT DataPin, ClockPin, Mode, STRING$, numebr-of-bits-to-be-sent

I immediately wired the MOD-LCD8x8 and wrote this small piece of code:

10 DP =1: CP = 2: LP=3 ‘define data, clock and latch pins
20 SETPIN DP,8: SETPIN CP,8: SETPIN LP,8 ‘make them outputs
30 A$ = CHR$(&h55)+CHR$(&h55)+CHR$(&h55) ‘ 10101010 10101010 101010
35 B$ = CHR$(&hAA)+CHR$(&HAA)+CHR$(&HAA) ‘01010101 01010101 01010101
40 SHIFTOUT DP,CP,0,A$,24 ‘send first pattern
50 PIN(LP)=1: PIN(LP)=0 ‘latch to display it
60 PAUSE 100 ‘wait a little bit
70 SHIFTOUT DP,CP,0,B$,24 ‘sent second pattern
80 PIN(LP)=1: PIN(LP)=0 ‘latch to display it
90 PAUSE 100 ‘wait a little bit
100 GOTO 40

as expected everything was working and I got nice blinking pattern on my LED-matrix

The great thing with MOD-LED8x8 is that I can stack them together to make any size LED display.

SHIFTOUT now works up to 235Khz so it also can be used to generate nice frequency digital patterns on any DuinoMite PIN.

Well done Iggy! Now Ken have just to include this code in the DuinoMite main firmware.

THIS IS THE POWER OF THE OPEN SOURCE!

the SHIFTIN code is also being prepared, and I have nice project with SHIFTIN command use in mind 😉

Leave a comment