Hello,
I've built an EEPROM programmer circuit with an Arduino microcontroller as described here:
http://z80dave.blogspot.com/2011/09/...er-part-2.html. The specifics are not important, but I need a script which will accomplish the following things:
1) open a file (format is not important) containing the data in hexadecimal to be transferred
2) send 64 bytes of data, wait a few seconds, then send another 64 bytes
3) repeat step 2 until all data has been transferred
The website I linked to provides the following script:
Quote:
eeprom_send.sh
Code:
#!/bin/bash
split -C 64 ${1} ${1}.part.
for part in `ls ${1}.part.*`
do
cat ${part} >> ${2}
sleep 1
done
rm -f ${1}.part.*
To use it type:
Code:
./eeprom_send.sh zx81.rom /dev/ttyACM0
|
Since I run Windows, I tried to execute this script under Cygwin, but I received an error message:
Code:
./eeprom_send.sh: line 4: syntax error near unexpected token `$'do\r''
'/eeprom_send.sh: line 4: `do
Nonetheless, the script does split the initial file into a number of individual 64 byte portions (e.g. zx81.rom.part.'aa,zx81.rom.part.'ab, etc.) No serial data is sent, however. (I did leave the Arduino serial monitor open during the execution, as instructed by the website)
Having no linux experience, I don't really know what to do at this point. Any suggestions would be greatly appreciated!