I2C Speed on CY8CKIT-059 | Cypress Semiconductor
I2C Speed on CY8CKIT-059
I have a CY8CKIT-059 , it's great, done lots of little things so far. Tonight I decided i'd try and write some values to a 12-bit DAC.
I looked at a few example projects etc and can not seem to get another to come out that makes sense above about 800Hz, it's all blocky and modulated.
I'm pretty sure the sample rate and the conversion rate are more than adequate. Any thing i'm missing? I might also be doing the bit shifting wrong,,,,
Code looks like this.
#define SLAVE_ADDRESS 0x62
#define WR_BUFFER_SIZE (2u)
/* Wait until the ADC conversion is complete */
/* Since the ADC conversion is complete, stop the conversion */
sample_full = ADC_1_GetResult16();
sample_segment = sample_full >> 8u & 0x00FFu;
sample_segment = sample_full & 0x00FFu;
I2C_1_MasterWriteBuf(SLAVE_ADDRESS, (uint8 *)sample_segment,WR_BUFFER_SIZE, I2C_1_MODE_COMPLETE_XFER);