diff --git a/ch55xduino/ch55x/libraries/Generic_Examples/examples/05.USB/USBtinySPI_CH552/USBtinySPI_CH552.ino b/ch55xduino/ch55x/libraries/Generic_Examples/examples/05.USB/USBtinySPI_CH552/USBtinySPI_CH552.ino index 36022a15..66f3bbf3 100644 --- a/ch55xduino/ch55x/libraries/Generic_Examples/examples/05.USB/USBtinySPI_CH552/USBtinySPI_CH552.ino +++ b/ch55xduino/ch55x/libraries/Generic_Examples/examples/05.USB/USBtinySPI_CH552/USBtinySPI_CH552.ino @@ -57,7 +57,7 @@ void setup() { P1_DIR_PU &= ~( (1 << 5) | (1 << 6) | (1 << 7) ); P1_MOD_OC &= ~( (1 << 5) | (1 << 6) | (1 << 7) ); SPI0_SETUP = 0; - SPI0_CTRL = 0x60; //mode 0 + SPI0_CTRL = 0; //mode 0 //RESET P1.1 P1_DIR_PU &= ~( (1 << 1) ); P1_MOD_OC &= ~( (1 << 1) ); diff --git a/ch55xduino/ch55x/libraries/Generic_Examples/examples/05.USB/USBtinySPI_CH552/src/tinySpiDWire/tinySpiFunc.c b/ch55xduino/ch55x/libraries/Generic_Examples/examples/05.USB/USBtinySPI_CH552/src/tinySpiDWire/tinySpiFunc.c index 6784e74d..4f6e1620 100644 --- a/ch55xduino/ch55x/libraries/Generic_Examples/examples/05.USB/USBtinySPI_CH552/src/tinySpiDWire/tinySpiFunc.c +++ b/ch55xduino/ch55x/libraries/Generic_Examples/examples/05.USB/USBtinySPI_CH552/src/tinySpiDWire/tinySpiFunc.c @@ -84,6 +84,7 @@ uint16_t tinySpiSetupHandler() { } // INIT SPI BUS P1_DIR_PU |= ((1 << 5) | (1 << 7)); + SPI0_CTRL = bS0_MOSI_OE|bS0_SCK_OE; //mode 0 P1_DIR_PU |= ((1 << 1)); P1_1 = 0; // Put reset pin to output low returnLen = 0; @@ -101,6 +102,7 @@ uint16_t tinySpiSetupHandler() { // set all the pins to Hi-Z // SPI P1_DIR_PU &= ~((1 << 5) | (1 << 6) | (1 << 7)); + SPI0_CTRL = 0; // RESET P1_DIR_PU &= ~((1 << 1)); P1_1 = 1;