Hi,
I have been working on my digital scoreboard project (see these threads for details: http://www.sparkfun.com/cgi-bin/phpbb/viewtopic.php?t=3897 and http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1154868522) for the last week or so. By following the suggestions posted on the Spark Fun forum, and using the SPI EEPROM tutorial found here: http://www.arduino.cc/en/Tutorial/SPIEEPROM I have been able to successfully connect the display unit and the Arduino. I was even able to see the display unit update itself when I uploaded the led_blink program to the board (although it wasn't displaying actual numbers.)
Now I have moved on to attempting to get the sample program that came with the display unit ported from Basic Stamp to Programming syntax. For the most part I have gotten it written, but there are a few sticking points that I just can't get past. Primarily the SHIFTOUT function in Basic doesn't seem to have a counterpart in Programming. The sample program I am working with is the first program listed in this spec sheet: http://user.pa.net/~bean/hc4led/HC4LED%20Datasheet.pdf
This is what the Basic reference says about the SHIFTOUT function.
SHIFTOUT Dpin, Cpin, Mode, [ OutputData { \Bits } { ,OutputData { \Bits }...} ]
Function
Shift data out to a synchronous serial device.
? Dpin is a variable/constant/expression (0 – 15) that specifies the I/O
pin that will be connected to the synchronous serial device's data
input. This pin will be set to output mode.
? Cpin is a variable/constant/expression (0 – 15) that specifies the I/O
pin that will be connected to the synchronous serial device's clock
input. This pin will be set to output mode.
? Mode is a variable/constant/expression (0 – 1), or one of two
predefined symbols, that tells SHIFTOUT the order in which data
bits are to be arranged. See Table 5.113 for value and symbol
definitions.
? OutputData is a variable/constant/expression containing the data to
be sent.
? Bits is an optional variable/constant/expression (1 – 16) specifying
how many bits are to be output by SHIFTOUT. When the Bits
argument is given, the BASIC Stamp transmits the rightmost
number of bits specifed, regardless of the Mode. If no Bits argument
is given, SHIFTOUT defaults to 8 bits.
Explanation
SHIFTIN and SHIFTOUT provide an easy method of acquiring data from
synchronous serial devices. Synchronous serial differs from asynchronous
serial (like SERIN and SEROUT) in that the timing of data bits (on a data
line) is specified in relationship to clock pulses (on a clock line). Data bits
may be valid after the rising or falling edge of the clock line. This kind of
serial protocol is called Synchronous Peripheral Interface (SPI) and is
commonly used by controller peripherals like ADCs, DACs, clocks,
memory devices, etc.
Can someone help me in getting the Programming equivalent of the Basic SHIFTOUT funtion?