View previous topic :: View next topic |
Author |
Message |
O-Family
Joined: 23 May 2010 Posts: 320 Location: Japan
|
Posted: Sun Jan 10, 2021 3:35 am Post subject: |
|
|
I changed the library of ST7789V to 240x320 pixels.
I don't have this LCD, so try 4 ways: landscape , portrait , upside , down.
The graphic instructions (LINE, BOX, LCDAT, etc) of BASCOM-AVR are limited to byte addressing (0-255) for LCD.
To specify a position where the screen address exceeds 255, put (1) in the variable [Offset256].
An address can not be drawn across 255 and 256.
If the address specification of each instruction is 256 or more, the description of the address value is the same whether 256 or 0. |
|
Back to top |
|
|
dj7th
Joined: 27 Nov 2015 Posts: 14
|
Posted: Mon Jan 11, 2021 1:19 pm Post subject: |
|
|
Thanks again for adapting the driver.
I have expanded the test program a bit and provided it with waiting cycles in order to be able to follow the video display (see attachments)
Is it to be expected that BASCOM-AVR will expand the graphic instructions to value ranges greater than 255 (word instead of byte)?
Many LCD displays on the market could then be better used. In my case, I will be able to implement my text and graphic programming with a few compromises . |
|
Back to top |
|
|
O-Family
Joined: 23 May 2010 Posts: 320 Location: Japan
|
Posted: Tue Jan 12, 2021 12:59 am Post subject: |
|
|
I'm glad that the display was done well!
Were all four display directions normal?
The problem that the address of the graphic instruction is limited to 255 is also reported to Mark.
However, it seems that there is no extension of word passing for graphic instructions.
Currently, there is no choice but to create a function in the original library or draw it with an offset like me.
If you devise the screen configuration, it will not be too much trouble! |
|
Back to top |
|
|
dj7th
Joined: 27 Nov 2015 Posts: 14
|
Posted: Mon Feb 01, 2021 12:46 pm Post subject: |
|
|
sorry for my late reply.
I have tested the 4 display options and can confirm that everything works fine.
However, I have a problem:
In contrast to a display with 4 lines and 20 characters, the data output on the graphic display is much slower, which makes real-time display of measured values almost impossible. My ATMEGA328 with 8MHz internal clock seems to be overwhelmed. |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Mon Feb 01, 2021 10:06 pm Post subject: |
|
|
a text lcd has a built in font. most graphical lcd do not have that.
you can increase the clock speed to 16 or 24 Mhz. Or use an Xmega which goes up to 32 mhz.
or use a serial based nextion , see also the shared code section. i think the nextion is a good alternative. _________________ Mark |
|
Back to top |
|
|
dj7th
Joined: 27 Nov 2015 Posts: 14
|
Posted: Tue Feb 02, 2021 2:56 pm Post subject: |
|
|
Thanks for the advice.
My ATMEGA328 only runs at 8MHz with the internal clock. I don't want to use an external clock, as experience has shown that this leads to interference in my hf receiver. Since the circuit exists as a finished board, unfortunately no other cpu can be used. |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Tue Feb 02, 2021 3:28 pm Post subject: |
|
|
dj7th wrote: | My ATMEGA328 only runs at 8MHz with the internal clock. I don't want to use an external clock, as experience has shown that this leads to interference in my hf receiver. |
You can push the internal R/C quite some by using max values for OSCCAL, a value of 255 gives about 14MHz.
Can make the difference between a 'tad too slow' vs. 'good enough'.
Only make sure you switch it back to default before any EEProm access.
Beside that, in case you use full screen updates now, you may get along better with partial updates.
Quote: | Since the circuit exists as a finished board, unfortunately no other cpu can be used. |
Then try to get along with what you have and make the best out of it. |
|
Back to top |
|
|
SZTRAD
Joined: 30 Dec 2019 Posts: 165
|
Posted: Tue Feb 02, 2021 3:31 pm Post subject: |
|
|
What it means in "real time". How often do you need to change the contents of the display? |
|
Back to top |
|
|
O-Family
Joined: 23 May 2010 Posts: 320 Location: Japan
|
Posted: Tue Feb 02, 2021 4:33 pm Post subject: |
|
|
This type of color LCD module uses an SPI interface to reduce wiring.
In addition, this library uses software SPI to freely arrange ports.
If make the library compatible with hardware SPI, you can expect some speedup, but you can not expect it.
In addition, the LCD controller sends a 1-byte command and 4-byte address for row addresses, and a 1-byte command and 4-byte address for column addresses , followed by 2 bytes color data to send to display a single dot.
In order to display one character, it requires dozens of times more data transmission than the character LCD.
Therefore, even if you increase the clock speed with 8-bit AVR, it will be quite difficult to update the full screen drawing in seconds.
I think that the fundamental countermeasure is to control using many ports in a parallel data type module.
I devised a program to divide the update of the character string of each part into time division and display it with a time lag. |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Tue Feb 02, 2021 5:04 pm Post subject: |
|
|
O-Family wrote: | you can expect some speedup, but you can not expect it. |
I'd expect the one or the other. |
|
Back to top |
|
|
SZTRAD
Joined: 30 Dec 2019 Posts: 165
|
Posted: Wed Feb 03, 2021 9:20 am Post subject: |
|
|
As written correctly MWS da can change the frequency of the RC oscillator upwards, but I would be careful to go outside the recommended frequency given by the manufacturer. The frequency is used not only for EEPROM but also for Flash and may not be able to change it back in the program.
O-family uses if he understood correctly 16-bit RGB, ie for a complete rewrite it needs to transfer 1,228,800 bits purely for data (320x240x16 bits). If I count on moving one bit 6 the instruction will get to the time 0.9216 seconds (if I count correctly). Data preparation is not counted at this time, so the time will be extended.
I see the acceleration of redrawing in the possibility of changing only what I need to change, as indicated by MWS. Or if I display the number 3.26 and need 3.21 I will only change the last number. It is longer to write in the program, but again the speed will increase significantly. That's why I asked what real time means for interviewers.
Of course, it would be much better to use xmeg and direct connection via DMA memory and SPI when the operator interface is outside the program itself. Or use a smart display like the already mentioned nextion.
RS |
|
Back to top |
|
|
dj7th
Joined: 27 Nov 2015 Posts: 14
|
Posted: Wed Feb 03, 2021 1:35 pm Post subject: |
|
|
Many thanks to everyone who has published information here.
In my next project I will consider these recommendations.
In the current project I will do a test with the 2.8 "Nextion display.
I think this is the most effective solution. |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Wed Feb 03, 2021 4:49 pm Post subject: |
|
|
SZTRAD wrote: | The frequency is used not only for EEPROM but also for Flash and may not be able to change it back in the program. |
Flash is prepared to run with higher clock, after all the controller runs up to 20MHz.
If executing single instructions only, that's 20 million commands per second, the flash must be able to fetch instructions in that speed, 14 MHz will do no harm to flash.
It's different with EEProm, which runs much slower, that's why I wrote to slow down to standard before accessing EEProm.
It's also not the case that you can do permanent damage, as you are able anytime to flash a new software, if the previous one failed.
OSCCAL is not a fuse, which would make changes permanently, instead it is a IO-register, which is set in the course of reset, datasheet:
Quote: | During reset, hardware loads the pre-programmed calibration value into the OSCCAL |
For programming the reset pin is pulled low by the programmer, which presets OSCCAL with the calibration value.
In this moment the program in flash is not active and thus can not alter the preset.
There are several ways to brick an AVR, OSCCAL can't brick it, maybe get it stuck temporarily.
Flash a new program and it's ok again. |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Wed Feb 03, 2021 5:34 pm Post subject: |
|
|
dj7th wrote: | Many thanks to everyone who has published information here.
In my next project I will consider these recommendations. |
If I were you I would consider being polite and answer some of the helpsters questions. Just in case you want to still have any helpsters the next time you get stuck.
And you will get stuck the way you do things.
You did push O-Family to alter his lib for you and if you would not have problems, it would have been unlikely to have your feedback.
With this display you finally found out, what you could have known before: it is not super speedy. Surprise, surprise.
However for a few curves, update of data, a.s.o. it maybe would fast enough, if the guy behind the screen is smart enough.
But instead of explaining where you got stuck, you flipflop to another one, now nextion is the lucky one.
I can not talk for O-Familiy, but I would be not happy, if my help was requested and at the first hurdles the one asking for my help jumps over board.
I consider such 'stealing my fun'.
Also SZTRAD asked you two times what 'real-time' actually means for you, you completely ignored him.
Surely I am not known as the most courteous player within this forum and what I tell, I tell straight forward, but it is my impression your behavior is impolite and unrespectful.
Do you know what a discussion is? It's a back and forth, mostly with a goal to solve a problem, and as well I bet the members here are happy to help, your discussion style leaves much to desire.
It's rather the kind of how a leacher behaves, and if this word does not belong to your dictionary, google it up. |
|
Back to top |
|
|
dj7th
Joined: 27 Nov 2015 Posts: 14
|
Posted: Wed Feb 03, 2021 6:38 pm Post subject: |
|
|
Hi WMS
sorry, but i would still like to reply to your completely inappropriate comment.
I am extremely grateful to O-Family for his support, even if it did not lead to the hoped-for success.
Many thanks for the hint from albertsm to use the Nextion display. That helped me a lot.
To my person:
I'm 77 years old and unfortunately not a skilled programmer, but more at home in hardware.
For over 10 years, BASCOM has been a tool that I could learn quickly and that I have been able to use without any help until now.
Stay healthy and pass on your knowledge |
|
Back to top |
|
|
|