added two clocks while ENX high to get RFFC5071 serial reads to work (thanks, Jared!)

This commit is contained in:
Michael Ossmann
2012-06-14 12:42:51 -06:00
parent 2c76cc9bd2
commit 06b63d9936
2 changed files with 12 additions and 2 deletions

View File

@ -144,11 +144,21 @@ uint16_t rffc5071_reg_read(uint8_t reg)
/* make sure everything is starting in the correct state */
gpio_set(PORT_MIXER, PIN_MIXER_ENX);
gpio_clear(PORT_MIXER, (PIN_MIXER_SCLK | PIN_MIXER_SDATA));
serial_delay();
gpio_set(PORT_MIXER, PIN_MIXER_SCLK);
serial_delay();
gpio_clear(PORT_MIXER, PIN_MIXER_SCLK);
serial_delay();
gpio_set(PORT_MIXER, PIN_MIXER_SCLK);
serial_delay();
gpio_clear(PORT_MIXER, PIN_MIXER_SCLK);
/* start transaction by bringing ENX low */
gpio_clear(PORT_MIXER, PIN_MIXER_ENX);
serial_delay();
while (bits--) {
if (data & msb)

View File

@ -72,7 +72,7 @@ int main(void)
while (1) {
//rffc5071_init();
//rffc5071_reg_write(0x7a, 0xf0ca);
if (rffc5071_reg_read(0x00) == 0xbefb)
if (rffc5071_reg_read(0x00) == 0xbefa)
gpio_set(PORT_LED1_3, (PIN_LED3)); /* LED3 on */
else
gpio_clear(PORT_LED1_3, (PIN_LED3)); /* LED3 off */