Hi there,
EDIT - please see latest posts. EDIT.
I'm using a Bosch ASIC in a project I'm toying with, and am trying to communicate with the chip over SPI, essential to its use. However, the Bosch datasheet is incredibly thin on SPI information. Here's all the SPI information on the chip.
I'm struggling with how to write code to interface with this chip, in my SPI setup I've got the following, to correspond with the MSB first requirements, and the clock frequency set as the chip is max 2MBaud.
SPI.begin();
SPI.setBitOrder(MSBFIRST); // sets SPI data transfer to MSB first
SPI.setDataMode(SPI_MODE0); // sets SPI mode to MODE0
SPI.setClockDivider(SPI_CLOCK_DIV8); // sets shared clock rate to 16Mhz / 8 = 2Mhz
...and to actually read from a register, RD: 78H, I've got the following...
// select chip
digitalWrite(chip_select, LOW);
// send generic 01 address prefix
// send 78H hexadecimal address
SPI.transfer(0x78H);
// send parity?
SPI.transfer();
// send don't care, if needed?
// send 8 dummy bits of data
Any advice would be greatly appreciated;
- The generic 01 pre address, I'm not sure how to send this? What to type
- I'm not sure what parity is?
- Don't care, I guess I need to send a bit, 1 or 0?
- How would I go about sending those 8 dummy bits?
- That leads me into a whole other ball park, how do I go about reading/saving the bits sent back?
Many thanks in advance.