PDA

View Full Version : arraywrite takes too much memory, is there any way for optmisation?



CuriousOne
- 24th October 2022, 05:49
Hello.
I'm building an educational device, which has a lot of text to display.
Using ST7920 with own "library" to have 8 lines of 16 characters on 128x64 pixels screen.
The issue is, that arraywrite/read takes too much memory. For example, the code below takes about 400 bytes of memory.



if dta>olddta then arraywrite topline, ["trendi:","a]mavali "]
if dta<olddta then arraywrite topline, ["trendi:da]mavali "]
if dta=olddta then arraywrite topline, ["trendi:stabiluri "]
olddta=dta


Is there any other way for storing large text lines like this? (other than using internal/external EEPROM) ?

retepsnikrep
- 24th October 2022, 06:13
What device are you using?

richard
- 24th October 2022, 08:11
nothing has changed since last time you asked the same question
http://www.picbasic.co.uk/forum/showthread.php?t=24442

CuriousOne
- 24th October 2022, 09:13
I'm using PIC16F1939, as the biggest memory (16K and fastest (32mhz) in 16F family.
I just came to idea - since reading external EEPROM is quite slow
what if I use some SRAM chip, with parallel access, like CY7C199, copy data from EEPROM to it at startup, and access it as required?

richard
- 24th October 2022, 11:35
15 address pins
8 bidirectional i/o pins
r/w control pin
oe pin
ce pi
hope you don't want the pic to do much else other than be a pin jockey for all them controls

and you think that will be easier to get going than learning to use flash memory

CuriousOne
- 24th October 2022, 14:47
Yes it will take a lot of pins.
I'm using I2CREAD/I2CWRITE w/o any issues, but it is slow.

Ioannis
- 25th October 2022, 17:49
Flash memory is more manageable as Richard noted.

Observe how selected PIC is controlling read/write pages and do it nice and fast.

Ioannis