Creando la tabella funziona solo che sono indirizzi consecutivi, volevo memorizzare alcuni byte in precisi indirizzi, non si puo fare senza creare una tabella?
Grazie
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
By creating the table it only works that they are consecutive addresses, I wanted to store some bytes in specific addresses, can't you do without creating a table?
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Devo salvare dei codici a blocchi di 10~20 byte, inizializzare il primo byte del blocco alla prima accensione e mi bastava scrivere 10 byte. Comunque adesso valuto se creare 10 tabelle o trovare altre souzioni.
Molte grazie per l'attenzione
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am working on an old software and I have to make some small changes bringing everything in GCB I have not finished yet but I see that there is little program memory space left.
How does PROGMEM work?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just looked at the datasheet. I dont think this is a self write chip so writing to PROGMEM may not work.
So, do this.
Create your GCB program. Generate the ASM. Create a second ASM source of your required ORG2100 EEMEM. Then, concat the GCB generated ASM with this EEMEM,ASM and use MPASMX.EXE to link to gen the HEX.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I can provide a really simple method to do load the EEMEM. However. you code of +200 will not work as there is on 127 bytes of EEMEM. :-(
This will require the latest version of the compiler.
Evan
;Program compiled by Great Cow BASIC (0.98.<<>> 2020-11-09 (Windows 64 bit));Need help? See the GCBASIC forums at http://sourceforge.net/projects/gcbasic/forums,;check the documentation or email w_cholmondeley at users dot sourceforge dot net.;********************************************************************************;Set up the assembler options (Chip type, clock source, other bits and pieces)LISTp=16F628, r=DEC
#include<P16F628.inc>__CONFIG_CP_OFF&_CPD_OFF&_LVP_OFF&_MCLRE_OFF&_WDTE_OFF&_FOSC_HS;********************************************************************************;VectorsORG0pageselBASPROGRAMSTARTgotoBASPROGRAMSTART;********************************************************************************;ORG 5callINITSYS;Start of the main program;Do not change;End of fo not change;Data Lookup Tables (data memory)ORG0x2100de1,2,3ORG(0x2100+50)de1,2,3ORG(0x2100+100)de1,2,3;Do not changeORG4retfieORG5BASPROGRAMSTART;Call initialisation routines;call INITSYScallINITSYS;End of fo not change;add you code here.;always this at the end of you user programBASPROGRAMEND;sleepsleep;goto BASPROGRAMENDgotoBASPROGRAMEND;********************************************************************************;Source: system.h (117)INITSYS;asm showdebug _For_selected_frequency_-_the_external_oscillator_has_been_selected_by_compiler ChipMHz;asm showdebug _Complete_the_chip_setup_of_BSR,ADCs,ANSEL_and_other_key_setup_registers_or_register_bits;Turn off comparator - this is the default setting;CMCON = 7movlw7movwfCMCON;;'Turn off all ports;PORTA = 0clrfPORTA;PORTB = 0clrfPORTBreturn;********************************************************************************END
The program creates a specific startup routine permitting the additional table data to be managed. The program is only for those who know exactly what they are doing! As this removes all the automated init by the compiler.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Unfortunately, Great Cow Basic does not have a Directive to embed EEEPROM data into a hex file. However it can be done manually if you will follow these steps. You will need to have MPASMX installed On your PC. The last version comes with MPLABX Ver 5.30
Complete your Great Cow Cow Basic CODE and make sure it works as expected.
Open the ASM for your code
Somewhere around line 14 you will find the following:
Open MPASMX
A. Uncheck the Case Sensitive box
B. Click on Browse and find your ASM file and open it
C. Click on "ASSEMBLE"
D. If there are no errors you now have a good hex file
Open PICKIT2 GUI
A. Select your chip
B. Import the Hex file you just made
C. Look in the EEPROM Area
D. You should see the EEPROM Data ( See Attached Image)
Hello to all,
you can initialize the EEPROM to programming the chip as MPASM in asm.
I need a few bytes in precise locations.
Es. for pic16F628
ORG 0x2100
DE 100
ORG 0x2100+100
DE 150
ORG 0x2100+250
DE 200
Is this the base address of the EEPROM?
Will yield the following. Change your code to handle the number #3 at address 0x00
Creando la tabella funziona solo che sono indirizzi consecutivi, volevo memorizzare alcuni byte in precisi indirizzi, non si puo fare senza creare una tabella?
Grazie
By creating the table it only works that they are consecutive addresses, I wanted to store some bytes in specific addresses, can't you do without creating a table?
Thanks
To answer your initial question re ORG etc the answer is no.
So, what are you actually trying to achieve? As I am guessing.
Devo salvare dei codici a blocchi di 10~20 byte, inizializzare il primo byte del blocco alla prima accensione e mi bastava scrivere 10 byte. Comunque adesso valuto se creare 10 tabelle o trovare altre souzioni.
Molte grazie per l'attenzione
Does the 10-20 bytes need to survive a reset (so, you reinit the 10-20 byte block) or does the 10-20 bytes need to be un-altered after a reset?
They must remain after a reset
How much PROGMEM space do have left? So, how much headroom have you left ? Can we use PROGMEM to hold the setup for the EEPROM?
I am working on an old software and I have to make some small changes bringing everything in GCB I have not finished yet but I see that there is little program memory space left.
How does PROGMEM work?
I just looked at the datasheet. I dont think this is a self write chip so writing to PROGMEM may not work.
So, do this.
Create your GCB program. Generate the ASM. Create a second ASM source of your required ORG2100 EEMEM. Then, concat the GCB generated ASM with this EEMEM,ASM and use MPASMX.EXE to link to gen the HEX.
Yes, I think this last solution is the simplest and most practical one to do.
You can automate all this. If you need help then do ask.
I do have a method to generate valid asm!
I can provide a really simple method to do load the EEMEM. However. you code of +200 will not work as there is on 127 bytes of EEMEM. :-(
This will require the latest version of the compiler.
Evan
Last edit: Anobium 2020-11-24
The source is here.
https://github.com/Anobium/Great-Cow-BASIC-Demonstration-Sources/blob/master/EEPROM_Solutions/Create_datatables_in_EEMem/Create_datatables_in_EEMem_16F.gcb
The program creates a specific startup routine permitting the additional table data to be managed. The program is only for those who know exactly what they are doing! As this removes all the automated init by the compiler.
Yes you are right the EEPROM is only of 127 byte
OK, i have try but it doesn't work on my version 0.98.07 RC24 2020-09-06 (Windows 64 bit)
So in this way I do not disable the comparators automatically and I have to do it manually?
Email me and I will send the new/latest compiler, RC32
I can't find your email address, where can I find it?
I have sent you a personal message (PM)
Or, if you cannot find (because your contact email is incorrect or Sforge emails get set to spam) then send me a PM.
Sorry but I can't find private messages on this forum !! neither receive them nor send them strange maybe I have something wrong.
Last edit: Gigi 2020-11-24
you left click their name and click send message, i think
It doesn't work, I can't send or receive any PMs, I've checked my profile but haven't solved it.
Hi Gigi
Unfortunately, Great Cow Basic does not have a Directive to embed EEEPROM data into a hex file. However it can be done manually if you will follow these steps. You will need to have MPASMX installed On your PC. The last version comes with MPLABX Ver 5.30
Somewhere around line 14 you will find the following:
Immediately after the code above add the following code.
Save File. (Do not click on ASM)
Open MPASMX
A. Uncheck the Case Sensitive box
B. Click on Browse and find your ASM file and open it
C. Click on "ASSEMBLE"
D. If there are no errors you now have a good hex file
Open PICKIT2 GUI
A. Select your chip
B. Import the Hex file you just made
C. Look in the EEPROM Area
D. You should see the EEPROM Data ( See Attached Image)
Too bad there is no specific directive, however it is very simple to implement when needed.
Thanks
Gigi