I needed to test the SPI library with the newterm branch. I had a nice display from a dead Siemens phone (optipoint 500 something). It uses a KS0074 display (which is an sortof SPI version of the good old HD44780). I found the datasheet
http://www.chipdocs.com/datasheets/datasheet-pdf/Samsung-Electronic/KS0074.html and some example code on the internet
http://www.schorsch.at/content/view/25/1/lang,de/ (sorry only german is available). During the testing i found out the buspirate spits out the bits the other way around then in the code/datasheet. As the old firmware has also the same error i assume it is ok. Pictures at my rig:
http://www.xs4all.nl/~cdongen1/IMG_9541_.jpg and the final result:
http://www.xs4all.nl/~cdongen1/IMG_9543_.jpg (large picture alert!).
here is the actions and descriptions, for exact details refer to the datasheet:
(note this uses some new commands!! and is not 100% compatible with the old syntax!!)
first setup SPI:
m 5 4 1 2 1 1
enable pullups:
P
enable voltage regualtors
W
display init and clear screen:
[ 0xf8 0xf0 0x00 0x80 0x00 ]
switch to normal input
[ 0xfa
text 1st line:
0x40 0x20 0xa0 0xa0 0xc0 0xa0 0x00 0xa0
0x90 0x20 0x40 0xa0 0x80 0x20 0x20 0xa0
0xa0 0x20 0x00 0x40 0xf0 0x20 0x70 0x20
0x00 0x40 0x60 0xa0 0x30 0x20 0xe0 0x20
0xa0 0x20 0xb0 0x20 0x80 0xc0 0x00 0xc0
0x40 0xc0 0x80 0xc0 0x80 0x40 0x80 0x40
cs low:
]
program a diode to chram pos 0x00:
[ 0xf8 0x00 0x20 ]
[ 0xfa 0x20 0x00 0xf0 0x80 0xf0 0x80 0x70 0x00 0x70 0x00 0x20 0x00 0xf0 0x80 0x20 0x00 ]
program an antenna to chram at 0x01 (no need to set address again)
[ 0xfa 0x80 0x80 0x50 0x00 0x20 0x00 0x20 0x00 0x20 0x00 0x20 0x00 0x00 0x00 ]
move to second line:
[ 0xF8 0x00 0x30 ]
display something on line 2
[ 0xFa 0x00 0x00 0x80 0x00 ]
log from hyperterminal:
Bus Pirate v3
Firmware v4.2 (newterm-r296) Bootloader v4.1
DEVID:0x0447 REVID:0x3043 (B5)
http://dangerousprototypes.com
HiZ> m 5 4 1 2 1 1
SPI ( 3 0 1 0 1 )
READY
SPI> P
Pull-up resistors ON
SPI> W
POWER SUPPLIES ON
SPI> i
Bus Pirate v3
Firmware v4.2 (newterm-r296) Bootloader v4.1
DEVID:0x0447 REVID:0x3043 (B5)
http://dangerousprototypes.com
*----------*
POWER SUPPLIES ON
Voltage monitors: 5V: 5.00 | 3.3V: 3.35 | VPULLUP: 4.98 |
a/A/@ controls AUX pin
Open drain outputs (H=Hi-Z, L=GND)
Pull-up resistors ON
Bitorder configuration not allowed
*----------*
SPI> [ 0xf8 0xf0 0x00 0x80 0x00 ]
CS ENABLED
WRITE: 0xF8
WRITE: 0xF0
WRITE: 0x00
WRITE: 0x80
WRITE: 0x00
CS DISABLED
SPI> [ 0xfa
CS ENABLED
WRITE: 0xFA
SPI> 0x40 0x20 0xa0 0xa0 0xc0 0xa0 0x00 0xa0 0x90 0x20 0x40 0xa0 0x80 0x20 0x20 0xa0 0xa0 0x20 0x00 0x40
0xf0 0x20 0x70 0x20 0x00 0x40 0x60 0xa0 0x30 0x20 0xe0 0x20 0xa0 0x20 0xb0 0x20 0x80 0xc0 0x00 0xc0 0x40
0xc0 0x80 0xc0 0x80 0x40 0x80 0x40
WRITE: 0x40
WRITE: 0x20
WRITE: 0xA0
WRITE: 0xA0
WRITE: 0xC0
WRITE: 0xA0
WRITE: 0x00
WRITE: 0xA0
WRITE: 0x90
WRITE: 0x20
WRITE: 0x40
WRITE: 0xA0
WRITE: 0x80
WRITE: 0x20
WRITE: 0x20
WRITE: 0xA0
WRITE: 0xA0
WRITE: 0x20
WRITE: 0x00
WRITE: 0x40
WRITE: 0xF0
WRITE: 0x20
WRITE: 0x70
WRITE: 0x20
WRITE: 0x00
WRITE: 0x40
WRITE: 0x60
WRITE: 0xA0
WRITE: 0x30
WRITE: 0x20
WRITE: 0xE0
WRITE: 0x20
WRITE: 0xA0
WRITE: 0x20
WRITE: 0xB0
WRITE: 0x20
WRITE: 0x80
WRITE: 0xC0
WRITE: 0x00
WRITE: 0xC0
WRITE: 0x40
WRITE: 0xC0
WRITE: 0x80
WRITE: 0xC0
WRITE: 0x80
WRITE: 0x40
WRITE: 0x80
WRITE: 0x40
SPI> ]
CS DISABLED
SPI> [ 0xf8 0x00 0x20 ]
CS ENABLED
WRITE: 0xF8
WRITE: 0x00
WRITE: 0x20
CS DISABLED
SPI> [ 0xfa 0x20 0x00 0xf0 0x80 0xf0 0x80 0x70 0x00 0x70 0x00 0x20 0x00 0xf0 0x80 0x20 0x00 ]
CS ENABLED
WRITE: 0xFA
WRITE: 0x20
WRITE: 0x00
WRITE: 0xF0
WRITE: 0x80
WRITE: 0xF0
WRITE: 0x80
WRITE: 0x70
WRITE: 0x00
WRITE: 0x70
WRITE: 0x00
WRITE: 0x20
WRITE: 0x00
WRITE: 0xF0
WRITE: 0x80
WRITE: 0x20
WRITE: 0x00
CS DISABLED
SPI> [ 0xfa 0x80 0x80 0x50 0x00 0x20 0x00 0x20 0x00 0x20 0x00 0x20 0x00 0x00 0x00 ]
CS ENABLED
WRITE: 0xFA
WRITE: 0x80
WRITE: 0x80
WRITE: 0x50
WRITE: 0x00
WRITE: 0x20
WRITE: 0x00
WRITE: 0x20
WRITE: 0x00
WRITE: 0x20
WRITE: 0x00
WRITE: 0x20
WRITE: 0x00
WRITE: 0x00
WRITE: 0x00
CS DISABLED
SPI> [ 0xF8 0x00 0x30 ]
CS ENABLED
WRITE: 0xF8
WRITE: 0x00
WRITE: 0x30
CS DISABLED
SPI> [ 0xFa 0x00 0x00 0x80 0x00 ]
CS ENABLED
WRITE: 0xFA
WRITE: 0x00
WRITE: 0x00
WRITE: 0x80
WRITE: 0x00
CS DISABLED
SPI>