12.07.2015 Views

Programming Manual Elektor Proton Robot - ELEKTOR.se

Programming Manual Elektor Proton Robot - ELEKTOR.se

Programming Manual Elektor Proton Robot - ELEKTOR.se

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

READ DATA FROM THE SLAVEFor example: we want to read the data from slave 1 at index position 0x01 (for this example weassume that the value in this register is 0xDE)The<strong>se</strong> are the steps that you will need to program:1 START Start the message2 SENDBYTE 0x10 Send the slave address of Slave 20x10 = 0b 0001 0000 - LSB is 0 so this is a write operation3 SENDBYTE 0x01 Set the pointer in slave 2 at index 0x014 RESTART Restart instruction to indicate change to read mode5 SENDBYTE 0x11 Send the slave address of Slave 2 – LSB = 10x11 = 0b 0001 0001 - LSB is 1 so this is a READ operation6 READBYTE Master reads data from ‘READ position’ at index 0x01 – (allthat the master does here is generate 8 clock pul<strong>se</strong>s andgenerate an ACK bit. To clock in the 8 bit data from the slave)7 STOP Stop the messageSee picture below:SDASCLMASTERSLAVE ADRESS: 0x10INDEX READ WRITE0x000x01 0xDE0x02SLAVE 1 SLAVE 2SLAVE ADRESS: 0xE0INDEX READ WRITE0x000x010x020xAA0x320x32Bart Huyskens <strong>Manual</strong> <strong>Elektor</strong> <strong>Proton</strong> V1.0 3 April 2011 45

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!