yes, it works :)
i add some lines of code in the pdp1.h and recompile the file with "make -C /opt/pidp1/src/blincolnlights/pdp1"
the pdp1.c sends now the data of the io-register to a small bash-script, and the bash-script splits the data to 3 pcf8574 ic's to drive some LED's.
the code i have added to pdp1.h in the iot_pulse-function:
case 010:
if(pulse) {
char command[80];
sprintf(command, "/opt/pidp1/bin/iot_device.sh 1 %d", IO);
system(command);
}
break;
the pins of the pcf's are all High when power on, so i added a init-script to the pdp1control.sh to switch off all leds at the start.
but first you must enable the i2c bus in the raspi-config, and install the i2c-dev-tools.
then you can test the pcf's with i2cdetect and i2cset (i2cset is used from the bash-script)
both scripts are placed in the /opt/pidp1/bin directory.
now you cann write some code to bring the lights up.
0010 000001 /value for the iot device
0011 220010 /lio (0010)
0012 720010 /iot 10
0013 760400 /hlt
for short playing around, this ist enough code, play around with the value in 0010 and let it run, start is at 0011.
in the picture you can see that the io is the same linke the leds, also you see the instruction in the memory buffer 720010
later i make a short video.
i have added a zipfile with the 2 files for testing whose interested.
the pcf8574's had the addresses 0x20,0x21,0x22 for bits 0-7,8-15,16-17
the files are work in process and not cleaned up, i think new version are following in the next days.
the leds are driven bei a uln2803 ic, because the current of the led's is to high for the port expander.
if anyone is able to include the i2c functions in c , you are welcome :)
matthias