This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to Switch from spi0 to i2c0

Hi

i am using NRf51822 custom board. In that i have NOR(spi0) and LED(i2c0).

But switching from spi0 to i2c0 is not possible so that i am not able to switch

off led. But once i comment the spi_master_init(), led is going to off.

I know both uses same id means have same base address.

Kindly suggest how to switch from spi0 to i2c0.

i am not going to change spi and i2c bus for NOR and LED , because i have some other peripherals,

which is connected to i2c1 and spi1 bus.

Regards Balaji

Parents
  • Hi

    It means for NOR i am using spi0 bus and for LED i am using i2c0 bus.

    Here is Pseudo code:

    twi_master_init(); //i2c0 initialization for LED red_orange_periodicaly_05s(); //some i2c write calls to blink led. spi_master_init(SPI0,SPI_MODE0,0); //spi0 initialization for NOR read_Nor_send_to_ble_stack(); //some spi transfer call to read data from Nor. twi_master_init_rgb(); //i2c0 initialization for LED stop_led(); //some i2c write call to stop led.

    But here i am able to switch on LED and able to read data from NOR.

    but not able to switch off LED. but once i comment spi_master_init(SPI0,SPI_MODE0,0); LED is

    going to off.

    Kindly suggest me.

    Regards Balaji

Reply
  • Hi

    It means for NOR i am using spi0 bus and for LED i am using i2c0 bus.

    Here is Pseudo code:

    twi_master_init(); //i2c0 initialization for LED red_orange_periodicaly_05s(); //some i2c write calls to blink led. spi_master_init(SPI0,SPI_MODE0,0); //spi0 initialization for NOR read_Nor_send_to_ble_stack(); //some spi transfer call to read data from Nor. twi_master_init_rgb(); //i2c0 initialization for LED stop_led(); //some i2c write call to stop led.

    But here i am able to switch on LED and able to read data from NOR.

    but not able to switch off LED. but once i comment spi_master_init(SPI0,SPI_MODE0,0); LED is

    going to off.

    Kindly suggest me.

    Regards Balaji

Children
No Data
Related