LCD

Related to the the forum.
Ferro Ferido
Posts: 4
Joined: Wed Jan 13, 2021 7:23 pm

LCD

Post by Ferro Ferido »

I want make a EEG using the Blue Pill board. I need a LCD what can show graphics in real time, any suggestion? I never build any like this one. I'm sorry for my english, i'm brazilian and i'm learning the english language.
mrburnette
Posts: 352
Joined: Thu Dec 19, 2019 1:23 am
Answers: 1

Re: LCD

Post by mrburnette »

Start by reviewing existing material on the subject, for example
https://www.instructables.com/DIY-EEG-a ... t/#discuss

What function do you wish the uC to perform? The A/D of the bluepill is not appropriate for EEG.

One can easily drive a TFT such as an ILI9341 from the bluepill, but the analog frontend must be built around an instrumentation amplifier (IC or homebrew OpAmp design.)

The old forum had a thread on pig-o-scope, here is a write-up:
https://satoshinm.github.io/blog/180106 ... scope.html
GonzoG
Posts: 88
Joined: Wed Jan 15, 2020 11:30 am
Answers: 5

Re: LCD

Post by GonzoG »

The fastest are LCDs with parallel interface, but they need up to 20 MCU pins.
The higher resolutions the longer it takes to send 1 frame to LCD.
ag123
Posts: 584
Joined: Thu Dec 19, 2019 5:30 am
Answers: 2

Re: LCD

Post by ag123 »

if you don't need anything 'big' Adafruit has that ILI9341 320x240
https://www.adafruit.com/product/1770 2.8"
https://www.adafruit.com/product/1743 3.2"

and Adafruit has a nice library for it
https://github.com/adafruit/Adafruit_ILI9341
and
https://github.com/adafruit/Adafruit-GFX-Library
they go together

Adafruit made a tutorial
https://learn.adafruit.com/adafruit-gfx ... cs-library

if you use libmaple core, try searching in the libraries, but that is 'old' so your mileage may vary

not really promoting for Adafruit but that Adafruit developed this library, so credit is due

these used to be the videos that wow the crowds ;)
https://www.youtube.com/watch?v=5mDnKBNl9sY
https://www.youtube.com/watch?v=_SmLlGAyRRc

if you need a big screen, e.g. many channels, one way is to send that data back to the PC using usb serial.
then you can work out an app that display that data
only limited by the usb 2.0 full speed interface, spec 12 Mbps, but what tend to be achieved is possibly like 1-2 Mbps, one could try to optimize the calls e.g. using block transfers, using less bits per samples etc

i tried making a 'usb oscilloscope' like such prior
https://github.com/ag88/GirinoSTM32F103duino
Ferro Ferido
Posts: 4
Joined: Wed Jan 13, 2021 7:23 pm

Re: LCD

Post by Ferro Ferido »

mrburnette wrote:
Thu Jan 14, 2021 1:25 pm
Start by reviewing existing material on the subject, for example
https://www.instructables.com/DIY-EEG-a ... t/#discuss

What function do you wish the uC to perform? The A/D of the bluepill is not appropriate for EEG.

One can easily drive a TFT such as an ILI9341 from the bluepill, but the analog frontend must be built around an instrumentation amplifier (IC or homebrew OpAmp design.)

The old forum had a thread on pig-o-scope, here is a write-up:
https://satoshinm.github.io/blog/180106 ... scope.html
Man, i was search this LCD because i saw this one one year ago, thanks, i'm really thankfull.
Ferro Ferido
Posts: 4
Joined: Wed Jan 13, 2021 7:23 pm

Re: LCD

Post by Ferro Ferido »

When i compile a example of Adafruit Library the Arduino IDE show me that:


c:/users/lenovo/appdata/local/arduino15/packages/stm32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: address 0x8009040 of C:\Users\Lenovo\AppData\Local\Temp\arduino_build_811333/sketch_jan19b.ino.elf section `.text' is not within region `FLASH'
c:/users/lenovo/appdata/local/arduino15/packages/stm32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\Lenovo\AppData\Local\Temp\arduino_build_811333/sketch_jan19b.ino.elf section `.rodata' will not fit in region `FLASH'
c:/users/lenovo/appdata/local/arduino15/packages/stm32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: address 0x8009040 of C:\Users\Lenovo\AppData\Local\Temp\arduino_build_811333/sketch_jan19b.ino.elf section `.text' is not within region `FLASH'
c:/users/lenovo/appdata/local/arduino15/packages/stm32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: region `FLASH' overflowed by 8676 bytes
collect2.exe: error: ld returned 1 exit status
exit status 1
Erro compilando para a placa Generic STM32F1 series

What means it?
User avatar
fpiSTM
Posts: 912
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 36
Location: Le Mans
Contact:

Re: LCD

Post by fpiSTM »

This means there is not enough space to store the program in the flash.
feluga
Posts: 50
Joined: Wed Mar 18, 2020 2:50 am

Re: LCD

Post by feluga »

Ferro Ferido wrote:
Tue Jan 19, 2021 5:33 am
eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\Lenovo\AppData\Local\Temp\arduino_build_811333/sketch_jan19b.ino.elf section `.rodata' will not fit in region `FLASH'
.rodata is the read only data area used for constant data arrays or variables.
Given that you said that you are using Adafruit Library for LCD, It sounds like your sketch has some declaration for, maybe, a too large image (?)
This data blob along with the compiled code doesn't fit the Flash space of the board model selected in the IDE Menu.

If you are using a Bluepill, have you tried to change the board to "BluePill F103CB (or C8 with 128k)" in the Tool option on the IDE Menu?
It could solve the problem of lack of space, once most BluePills have 128K Flash instead of the reported 64K.
TFTLCDCyg
Posts: 7
Joined: Tue Jan 07, 2020 9:50 pm

Re: LCD

Post by TFTLCDCyg »

It would help to know more about the sketch you have uploaded. Perhaps a board with higher features like the F407 could be better. There are small format boards with chips like: STM32F407VET6 or STM32F407VGT6
ag123
Posts: 584
Joined: Thu Dec 19, 2019 5:30 am
Answers: 2

Re: LCD

Post by ag123 »

agree for beginners, life is easier starting with a bigger mcu e.g. in the stm32f4xx series.
check out the nucleo boards from st if you are using the official stm core.
https://github.com/stm32duino/Arduino_Core_STM32
in particular check the specs of the relevant stm32f4xx mcu specs on stm web site for the ram and flash sizes.
if you are new to micro-controllers programming, that stm32f103c8 blue pill only has 20k sram and 64k flash.
the 20k sram is particularly limiting and 64k flash isn't really a lot either, but works well for 'small' apps.

recently the somewhat more popular ones are the stm32f401 and stm32f411 boards
https://www.aliexpress.com/wholesale?ca ... =stm32f401
the stm32f401 and stm32f411 mcus (again check the specs) are a little less squeezy compared to stm32f103c8 and they have 32bit fpu.
floating point calcs is *much* faster.

i'm messing with a ili9341 lcd currently with the Adafruit library. struggling with various problems as well, no display, takes time to 'debug' and troubleshoot what is going on.

if you do not already have the lcd, i'd suggest to try sending the data back to your pc on the serial monitor. it is as easy as

Code: Select all

Serial.println(data);
and if you do not need very high speeds you can even use

Code: Select all

void setup() {
	pinMode(PA0, INPUT_ANALOG);
}

void loop() {
	Serial.println(analogRead(PA0));
	delay(1);
}
if you pair that with a Raspberry Pi over usb, i'd guess you can even plot that data on a big computer monitor.

if you need more accurate timings, that can be achieved with a hardware timer. u'd need to read up on that e.g. in the wiki and examples.
i've done something that way by hooking a h/w timer interrupt to fire at regular intervals. so that i've about 300 samples per sec, Arduino api as above is adequate at those speeds.
Post Reply

Return to “Ideas & suggestions”