avrxml / asf

merry christmas, have some asf without registration
151 stars 108 forks source link

Not working on SAM3x8E (Arduino Due) -- changes to get it working #8

Open martinzw opened 5 years ago

martinzw commented 5 years ago

ILI9225.c

I tried to get my (china) ILI9225 working with ASF and this lib on "Arduino Due" with it's SAM3x8E controller and it's hardware SPI0. After days of research I found, why it does not work: 1) SPI_MODE_3 instead of 1 has to be chosen (CLK-Signal idle high; capture on rising CLK) 2) 8 bits per Transfer has to be selected (do not switch it back to "default 16Bit" as noted in ili9225_write_cmd-function!!) 3) write_ram and write_ram_buffer functions have to call "spi_write" twice, one time for High-Byte, one time for Low-Byte of the uint16_t-Data: spi_write(BOARD_ILI9225_SPI, us_data>>8, BOARD_ILI9225_SPI_NPCS, 0); //High-Byte spi_write(BOARD_ILI9225_SPI, us_data&0x00FF, BOARD_ILI9225_SPI_NPCS, 0); //Low-Byte