Hi all, I’m using arduino nano 33 ble with Segger J-Link EDU mini . mbed os 6.8 and mbed studio 1.3.1
blinking hello world is ok, usb comunication is ok and now I try to use a tft with ILI9341. But failing to make it work…
I reduced the code to a minimum and tried simple SPI initialization:
#define LIGHT 0
#define DARK 1
DigitalOut led_red(LED_RED,DARK);
DigitalOut led_green(LED_GREEN,DARK);
DigitalOut led_blue(LED_BLUE,DARK);
SPI spi(SPI_PSELMOSI0, SPI_PSELMISO0, SPI_PSELSCK0); // mosi, miso, sclkDigitalOut cs(p23);
int main()
{cs = 1;
// Setup the spi for 8 bit data, high steady state clock,
// second edge capture, with a 1MHz clock rate
spi.format(8,3);
spi.frequency(1000000);// Select the device by seting chip select low
cs = 0;// Send 0x8f, the command to read the WHOAMI register
spi.write(0x8F);// Send a dummy byte to receive the contents of the WHOAMI register
int whoami = spi.write(0x00);
printf(“WHOAMI register = 0x%X\n”, whoami);// Deselect the device
cs = 1;
while (true) {
wait_us(BLINKING_RATE*1000);
led_blue=!led_blue;}
}
but the board turns on LED1 ( defined in pinnames.h) is it an error code? I saw from the mbed code that led1 is used flashing as an error code. But the led always on I did not find anything.Maybe I need to edit some json config files. Any ideas?
thanks Marco