The EEPROM command needs a name and an optional offSet address defaults to 0x00 if not stated.
The offset address and data block CANNOT overlap another EEPROM structure. EEPROM structures must not overlap TABLE data, and TABLE data has precedence from address 0x00 until the the end of TABLE data.
The dataset can be numbers, strings, calculations. Just the same as TABLE structures.
An example.
#chip 16F886#option explicit#DEFINE USART_BAUD_RATE 9600#DEFINE USART_TX_BLOCKING#DEFINE USART_DELAY OFFDimEEdataaddress,myvarasByteEEdataaddress=2ReadtableTwoBytes,EEdataaddress,myVarHSerPrintmyVar//******************EXAMPLEEEDATA//*THISISONLYACCESSIBLEVIAEPREADorotherEEreadfunctions./*Usage:'EEProm EEPromBlockName [[,] OffSet Address ] OffSetaddressdefaultsto0x00ifnotstated.AddressesanddatablockCANNOToverlap.AddressesmustnotoverlapTABLEdata.TABLEdatahasprecendencefromaddress0x00untilthetheendofTABLEdata*/EEPromEEDataSet10x10//LocateEEDataataddress3,2,1EndEEPromEEPromVersionData0x20//LocateEEDataataddress" PWM2Laser "" FABRICE ENGEL "" Version 1.4 "" November 2022 "EndEEPromEEPromEEDataSet20x0D//LocateEEDataataddress1,2,3EndEEPromEEPromEEDataSet0X04//LocateEEDataataddress1,2,3EndEEProm//**********************EXAMPLETABLEDATABEINGLOADEDINTOEEBYTHECOMIPILER//*THISISONLYACCESSIBLEVIAREADTABLETableTwoBytesSTOREdata//EEDataAddressAllocatedbycompiler0X55,0XAA,0X55EndTable
This create ASM as follows which is specific to the target chip.
I have updated the compiler to support AVR with the EEPROM capability. At the moment you have to use AVRASM to create the EEP file ( if you have to ask what this is... then you are probably not using an AVR chip .. it is the EEPROM hex file).
Preferences editor now supports AVRASM and you can use any AVRASM assembler. This is all configured within Preferences editor.
You can now create EEPROM reference datasets from within your source program.
It is very easy. You simply need to add the dataset to your source program using the new EEPROM structure, as follows:
The EEPROM command needs a name and an optional offSet address defaults to 0x00 if not stated.
The offset address and data block CANNOT overlap another EEPROM structure. EEPROM structures must not overlap TABLE data, and TABLE data has precedence from address 0x00 until the the end of TABLE data.
The dataset can be numbers, strings, calculations. Just the same as TABLE structures.
An example.
This create ASM as follows which is specific to the target chip.
When loaded into the chip ( this case an emulator ), the datasets are loaded in the EEPROM memory space, as follows:
This is available from build 1296 and onwards.
Help is ready on GitHub.
And, GCODE Helpers and Autocomplete will provide support.
Enjoy this new capability.
Last edit: Anobium 2023-11-08
Thanks go to FABRICE ENGEL for the new EEPROM capability.
He shared how another compiler handled EEPROM datasets and he has help test the solution.
THANKS
TO ALL: DONATE HERE
https://sourceforge.net/p/gcbasic/discussion/579125/thread/c635e2568c/
The reason to donate is that I can add great features and maintain the tool chain.
Please donate.
I have updated the compiler to support AVR with the EEPROM capability. At the moment you have to use AVRASM to create the EEP file ( if you have to ask what this is... then you are probably not using an AVR chip .. it is the EEPROM hex file).
Preferences editor now supports AVRASM and you can use any AVRASM assembler. This is all configured within Preferences editor.
I will post a video soon, and, I will post a version of AVRASM to https://sourceforge.net/projects/gcbasic/files/Support%20Files/MicrochipCompilers/ I will post the one I use.
Donate here
Please donate to the operational costs of GCBASIC for the coming year - Thank you. paypal.me/gcbasic