Solar Monitor

neiltechspec

Senior Member
Thought I would post this.

It's been running for 12 months now, undergone numerous revisions over that time.

Displays over 4 screens various stats from my Aerosharp Inverter, writes the daily output to an openlog micro SD card @ around 23:55

Code isn't the tidiest, or laid out like some would want - but do I care ????.

Neil
 

Attachments

neiltechspec

Senior Member
Yet another update.

Sertxd @ 19200 with pic running at 16mhz seemed to be inaccurate & not close enough to 19.2k.

So changed serial out to Lantronix IP2Serial to T9600_16 on pin C.4.

Program now uses 2048 bytes of 2048 bytes - it's full !.

Neil.
 

Attachments

lbenson

Senior Member
>Program now uses 2048 bytes of 2048 bytes - it's full !.

You realize that with PE6 you have another 2K slot available?
 

neiltechspec

Senior Member
Yes, I do realise that.

I did load PE6 & try it - totally confused me.

So still using PE5.5.6.

Program now up to Version 13, several tweaks & corrections, mainly around logging & data to Serial to IP device.

All recent versions due to squeezing it onto 1 chip from 2, logger for RTC & openlog was on a separate chip. Still full at 2048 bytes used.

Neil.
 

hippy

Ex-Staff (retired)
Program now uses 2048 bytes of 2048 bytes - it's full !
There is some scope for for code optimisation which could easily save 20% of memory.

Where you output a whole line of spaces to the display you could put a single SEROUT to do that in a subroutine and call that when needed. That will save around 300 bytes.

For ...

Code:
	serin [800],R485,baud2,b0,b1,b2,b3,b4,b5,b6,b6,b7,b7,b7,b8,b9,b10,b10,b10,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b20,b21,b22,b23
	
	poke 80,b0 poke 81,b1 poke 82,b2 poke 83,b3 poke 84,b4 poke 85,b5			;store captured bytes in
	poke 86,b6 poke 87,b7 poke 88,b8 poke 89,b9 poke 90,b10 poke 91,b11		;temporary spare variable
	poke 92,b12 poke 93,b13 poke 94,b14 poke 95,b15 poke 96,b16 poke 97,b17		;memory as some get
	poke 98,b18 poke 99,b19 poke 100,b20 poke 101,b21 poke 102,b22 poke 103,b23	;overwritten later
You can probably change all the 'bX' variables in the SERIN command to @bptrinc and have ...

Code:
bptr = 80
serin [800],R485,baud2,@bptrinc,@bptrinc...@bptrinc,@bptrinc
That saves about 70 bytes.
 
Top