davidbuckley.net
home  >  Libby  >  Software overview 20 June 2026

Libby's system consists of a mega2560 controller, controlling i/o sub-systems.
Commands are held in EEPROM,
Some pages in internal EEPROM are inherited from Bamduino at al.
Others are held in a 32k EEPROM arranged as 2 banks of 16k.
These banks I refer to as Books
Book 0 - internal EEPROM
Book 1 - first 16k bank
Book 2 - second 16k bank
Books 1 and 2 are subdivided into
8 Chapters of 2k - Acts, ReActs, Tasks, Skills, Voice, Mind, maps, Notes each Chapter has 8 Pages of 256 bytes - 1-8
Each Page has 8 Slots of 32 bytes. - 1-8
The Slots hold the Command strings and rules for Acts, Skills etc

each Map is 16x16 bytes so a Map can fit in a Page.

Any Slot can be copied to any other Slot
Any Page can be copied to any other Page
Each Slot has an address - eg A47
and the current division can be set by /
/b2 - set book 2 to be the current book
/A - set Chapter A - of A.!.T.S.V.M.m.N to be the current Chapter
/(1-8) - set Page to be the current Page
(1-8) - select Slot
eg
/b2/S/3 - selects Page 3 in Skills in Book 2
The commands in each Slot can include or jump to any other Slot
A32 - when run will execute then jump and run Chapter A, Page 3, Slot2.
[A32] - when run will execute then include Chapter A, Page 3, Slot2.
if 1 is in slot1 and run then will be executed and then a jump will be made to Slot 1 and so 1 will be repeated forever.
Slot1: <some commands>2
Slot2: <some more commands>1
will repeatedly execute <some commands><some more commands>

Slot contents can be sent as a <=32 byte string from a terminal
eg
/T/4/2*l6<command string>.
will load <command string> into Slot6 in Page 2 of Tasks of the current Book.
/T/4/2*lp<command string>.
will load a complete page into Page 2 of Tasks of the current Book where the page is formatted as <string1>.<string2>.<string3>.<string4>.<string5>.<string6>.<string7>.<string8>. - note the '.' separators.

To get round the fact that the mega2560 only has the standard 64 byte Serial Buffer I have a 256 byte RAM buffer filled from Serial.read(), then transferred to the desired EEPROM location. Serial.read() then write to RAM works fast enough so the serial buffer does not overflow for <=256 byte transfers, at least at 9600baud.

Any Slot or Page or Chapter can be printed out.
?3 - prints Slot3 of the current Page
?? - prints the current Page
?C - prints the current Chapter
?m - prints the current Map (?M is used to print the Mind)

So Pages of commands can be written off line and downloaded, and Maps can be written as text files and downloaded or uploaded and modified and downloaded again. Libby will also be able to modify the Maps, and later also modify commands in Slots.

Note
I was going to use 1k (32x32) maps.
I could use a 1k RAM buffer but that uses a lot of RAM.
So I expected to fill the RAM buffer, send xoff to stop further bytes being received, transfer the RAM buffer contents to the first page of the Map, send xon and fill the RAM buffer again, and repeat three more times to complete the map. BUT xon/xoff does not work in Win10, even after setting that in COM properties.
The Map pages could be filled by loading each page separately by eg /T/4/2*lp. - see above.
However 16x16 maps were easier. Maybe they will be upgraded to 32x32 later.