Firmware for SPI QVGA display - Page 1
Forum section: electronics / projects

author: Jester
author_rank: Frequent Contributor
timestamp: February 06, 2018, 05:44:01 pm
content: I'm looking for suggestions.........I would like to add a uController and a display to an existing project, perhaps this display, or something similar:https://www.aliexpress.com/item/2-8-SPI-ILI9341-TFT-LCD-Display-240x320-Touch-Panel-Serial-Port-Module-5V-3-3V/32666535328.html?spm=a2g0s.9042311.0.0.8UicH9The uC will simply be used to measure 6 voltages (need 6x 12 bit integral A/D) and display the voltages via the SPI link to the above or similar display.I'm not great at programming but can fudge my way through modifying existing C code if I can find some code that is close to what I'm looking for.I'm flexible as to which uController as long as it's fairly low cost, prefer a 16 or so pin SOIC package, but I'm flexible. I'm not looking for a kit type board as I will be integrating the above mentioned circuit to an existing circuit on the next revision. That being said some sort of PIC or ARM starter board would be useful for initial firmware development.Can anyone recommend a particular uC that would have existing firmware available from the manufacturer that would support a display and multi-channel A/D as described above?

author: Aodhan145
author_rank: Frequent Contributor
timestamp: February 06, 2018, 06:26:28 pm
content: Your best bet is probably an Arduino compatible microcontroller. There is a wide variety out there nearly any of them should be able to do what you're looking to do. Adafruit makes some of the best display libraries and they support the display you have linked. The most common one is the ATMega328P which should be fine for your use case. The cheapest ATMega328p is $1.20 from digikey and $2.20 in DIP package.https://github.com/adafruit/Adafruit_ILI9341https://learn.adafruit.com/adafruit-2-8-tft-touch-shield-v2

author: Jester
author_rank: Frequent Contributor
timestamp: February 06, 2018, 07:35:28 pm
content: Quote from: Aodhan145 on February 06, 2018, 06:26:28 pmThe 328 appears to have a 10 bit A/D and I require 12 bits.I have yet to play with an Arduino, I seem to recall reading that when using these "shields" that the uC needs to be programmed with some sort of Arduino code before you can use the library? I may be completely out in left field on this, or can I simple use these libraries with a regular blank uController?

author: Aodhan145
author_rank: Frequent Contributor
timestamp: February 06, 2018, 07:57:55 pm
content: Quote from: Jester on February 06, 2018, 07:35:28 pmThere are other microcontrollers that have Arduino core support. The ATSAMD21G18 has a 12bit ADC as well with 25 inputs with an ENOB of 10.5-11.1bits. The Arduino MKR Zero and the Adafruit feather M0+ use this microcontroller which you can use for reference. It is a $3.20 part if this influences your costs much.The Arduino bootloader is typically programmed before other Arduino code is as it gives the advantage of being able to program it over serial. The standard ISP programmer can just program the microcontroller straight without the first step. When your Arduino code is compiled the Arduino core is included so that's what is needed to use the Arduino libraries. Arduino is by far the simplest way to get projects working without much experience.

author: Jester
author_rank: Frequent Contributor
timestamp: February 07, 2018, 06:54:56 pm
content: Will this work for initial development, create a screen or two and exercise the A/D's?https://www.digikey.com/products/en?keywords=1050-1137-ND%20Do you think 256KB is enough FLASH?

author: Aodhan145
author_rank: Frequent Contributor
timestamp: February 07, 2018, 08:20:31 pm
content: Quote from: Jester on February 07, 2018, 06:54:56 pmLooks good. 256KB should be more than enough if there are any images you want to display on the screen you can use the SD Card to store them.

author: Jester
author_rank: Frequent Contributor
timestamp: February 07, 2018, 08:32:43 pm
content: Am I correct to assume that I would need 240x320 = 76,800 bytes for each complete screen, and so if I wanted to avoid the SD card I would be limited to three screens maximum and that is not taking into account the actual code I will be writing.

author: Aodhan145
author_rank: Frequent Contributor
timestamp: February 07, 2018, 09:09:05 pm
content: Quote from: Jester on February 07, 2018, 08:32:43 pmUsing the Adafruit GFX library the screens will just be generated at runtime, it shouldn't use much flash at all. The only thing you may want to store is a logo or any image you want to draw to the screen. The text and basic graphics are generated. The screen will have its own RAM which you write this data to.https://learn.adafruit.com/adafruit-gfx-graphics-library/graphics-primitives

author: Jester
author_rank: Frequent Contributor
timestamp: February 07, 2018, 09:33:30 pm
content: I ordered the board from Digi-Key, can't wait to play with it. Thank you for your advice.