Volhout Guru
 Joined: 05/03/2018 Location: NetherlandsPosts: 4722 |
Posted: 08:17am 31 Jan 2025 |
|
|
|
So summary:
- do not use a clock higher that 1MHz (the chip does 2 MHz max at 3.3V) - use 16 bit transfers (or 2x8 bit transfers as below) - you need to mask the read ADC value, since the MSB's are determined by pullup or pulldown. - you need to use SPI mode 0 (called "0.0" in the datasheet). in essence this chip understands SPI mode 0 and 3, but not 1 and 2. - you need to receive data while sending. use the function
value = SPI2( data ) Do not use commands SPI WRITE and SPI READ, since these do not operate at the same time.
as TassyJim said: SPI2 OPEN 1000000,0,16

Regards,
Volhout Edited 2025-01-31 18:24 by Volhout |