Hello, I don't undersant very well wich values should i put in these registers. My eeprom is at 0x400 to 0x7FF My RAM 0x800 to 0xFFF I have INITRM=9 INITEE=1 and INITRG=0 But i think that there is a pb between adress RAM and adress EEPROM Thank you very much for your help Regards |
|
Program INITRM INITRG INITEE on 9s12a64
Started by ●June 2, 2004
Reply by ●June 2, 20042004-06-02
In a message dated 6/2/04 7:02:51 AM Eastern Daylight Time, writes: I don't undersant very well wich values should i put in these registers. My eeprom is at 0x400 to 0x7FF My RAM 0x800 to 0xFFF I have INITRM=9 INITEE=1 and INITRG=0 But i think that there is a pb between adress RAM and adress EEPROM ========================================= Do you use c or assembler? I think the problem is: if you change the register location (for example), then every function compiled in the c run time library that used the old default location is now broken. If you recompile your whole library, then you have a new nonstandard incompatible version to be maintained separately from every other version. Big hassle. |
|
Reply by ●June 2, 20042004-06-02
Pascal, The 9S12A64 has 4K of internal RAM which may be mapped to start at any 4K address boundary (0x0000, 0x1000, 0x2000, ... 0xF000). It also has 1K EEPROM, which is can be mapped to start at any 2K boundary (0x0000, 0x0800, 0x1000, 0x1800, ... 0xF800) and is duplicated twice in this 2K boundary. It is therefore not possible on the 9S12A64 to locate the RAM from 0x800 to 0xFFF, like you try to do. An internal priority decoder in the HCS12 determines that in case one of the internal SFR registers or memory resources overlaps in its address another resource, the HCS12 will access only one resource for every specific address, according to the following priority: SFR registers - highest priority internal RAM internal EEPROM internal Flash External memory - lowest priority. In your case (INITRM=9 INITEE=1 and INITRG=0), the internal RAM and EEPROM overlap, and therefore it is not be possible to access the EEPROM (the internal RAM is accessed). Likewise, in your settings at the address range 0x0000 - 0x0400 - the SFR registers, RAM and EEPROM overlap, and therefore the SFR registers are accessed at the overlapped addresses, and the RAM and EEPROM are not. To avoid such overlap you probably need to move the SFR registers or/and internal RAM or/and the internal EEPROM to different addresses, as one of the first steps in your startup code. This is done by writing to the INITRG, INITRM and INITEE registers accordingly. Hope this helps, Doron Nohau Corporation HC12 In-Circuit Emulators www.nohau.com/emul12pc.html At 12:37 02/06/2004 +0200, you wrote: >Hello, > >I don't undersant very well wich values should i put in these registers. >My eeprom is at 0x400 to 0x7FF >My RAM 0x800 to 0xFFF > >I have INITRM=9 INITEE=1 and INITRG=0 > >But i think that there is a pb between adress RAM and adress EEPROM > >Thank you very much for your help > >Regards |
Reply by ●June 2, 20042004-06-02
Hello Doron, Thank you very much for your help. You have solved my big problem :o) Where did you find these informations? I could not see them. Regards ----- Original Message ----- From: Doron Fael To: Sent: Wednesday, June 02, 2004 1:22 PM Subject: Re: [68HC12] Program INITRM INITRG INITEE on 9s12a64 Pascal, The 9S12A64 has 4K of internal RAM which may be mapped to start at any 4K address boundary (0x0000, 0x1000, 0x2000, ... 0xF000). It also has 1K EEPROM, which is can be mapped to start at any 2K boundary (0x0000, 0x0800, 0x1000, 0x1800, ... 0xF800) and is duplicated twice in this 2K boundary. It is therefore not possible on the 9S12A64 to locate the RAM from 0x800 to 0xFFF, like you try to do. An internal priority decoder in the HCS12 determines that in case one of the internal SFR registers or memory resources overlaps in its address another resource, the HCS12 will access only one resource for every specific address, according to the following priority: SFR registers - highest priority internal RAM internal EEPROM internal Flash External memory - lowest priority. In your case (INITRM=9 INITEE=1 and INITRG=0), the internal RAM and EEPROM overlap, and therefore it is not be possible to access the EEPROM (the internal RAM is accessed). Likewise, in your settings at the address range 0x0000 - 0x0400 - the SFR registers, RAM and EEPROM overlap, and therefore the SFR registers are accessed at the overlapped addresses, and the RAM and EEPROM are not. To avoid such overlap you probably need to move the SFR registers or/and internal RAM or/and the internal EEPROM to different addresses, as one of the first steps in your startup code. This is done by writing to the INITRG, INITRM and INITEE registers accordingly. Hope this helps, Doron Nohau Corporation HC12 In-Circuit Emulators www.nohau.com/emul12pc.html At 12:37 02/06/2004 +0200, you wrote: >Hello, > >I don't undersant very well wich values should i put in these registers. >My eeprom is at 0x400 to 0x7FF >My RAM 0x800 to 0xFFF > >I have INITRM=9 INITEE=1 and INITRG=0 > >But i think that there is a pb between adress RAM and adress EEPROM > >Thank you very much for your help > >Regards --------------------To learn more about Motorola Microcontrollers, please visit http://www.motorola.com/mcu o learn more about Motorola Microcontrollers, please visit http://www.motorola.com/mcu ------ Yahoo! Groups Links a.. To |
|
Reply by ●June 2, 20042004-06-02
Hello Pascal, I work on HCS12 and HC12 emulators design for 8 years now, so after 8 years I know a thing or two on the HCS12 parts. The information is also available on Figure 1-2 on page 27 of: http://e-www.motorola.com/files/microcontrollers/doc/data_sheet/9S12DJ64DGV1.pdf It says there: 4K Bytes RAM (Mappable to any 4K Boundary) 1K Bytes EEPROM (Mappable to any 2K Boundary; 1K mapped two times in the 2K address space) Regards, Doron Nohau Corporation HC12 In-Circuit Emulators www.nohau.com/emul12pc.html At 16:39 02/06/2004 +0200, you wrote: >Hello Doron, > >Thank you very much for your help. You have solved my big problem :o) > >Where did you find these informations? I could not see them. > >Regards > ----- Original Message ----- > From: Doron Fael > To: > Sent: Wednesday, June 02, 2004 1:22 PM > Subject: Re: [68HC12] Program INITRM INITRG INITEE on 9s12a64 > Pascal, > > The 9S12A64 has 4K of internal RAM which may be mapped to start at any 4K > address boundary (0x0000, 0x1000, 0x2000, ... 0xF000). > > It also has 1K EEPROM, which is can be mapped to start at any 2K boundary > (0x0000, 0x0800, 0x1000, 0x1800, ... 0xF800) and is duplicated twice in > this 2K boundary. > > It is therefore not possible on the 9S12A64 to locate the RAM from > 0x800 to > 0xFFF, like you try to do. > > An internal priority decoder in the HCS12 determines that in case one of > the internal SFR registers or memory resources overlaps in its address > another resource, the HCS12 will access only one resource for every > specific address, according to the following priority: > > SFR registers - highest priority > internal RAM > internal EEPROM > internal Flash > External memory - lowest priority. > > In your case (INITRM=9 INITEE=1 and INITRG=0), the internal RAM and EEPROM > overlap, and therefore it is not be possible to access the EEPROM (the > internal RAM is accessed). > > Likewise, in your settings at the address range 0x0000 - 0x0400 - the SFR > registers, RAM and EEPROM overlap, and therefore the SFR registers are > accessed at the overlapped addresses, and the RAM and EEPROM are not. > > To avoid such overlap you probably need to move the SFR registers or/and > internal RAM or/and the internal EEPROM to different addresses, as one of > the first steps in your startup code. This is done by writing to the > INITRG, INITRM and INITEE registers accordingly. > > Hope this helps, > Doron > Nohau Corporation > HC12 In-Circuit Emulators > www.nohau.com/emul12pc.html > > At 12:37 02/06/2004 +0200, you wrote: > >Hello, > > > >I don't undersant very well wich values should i put in these registers. > >My eeprom is at 0x400 to 0x7FF > >My RAM 0x800 to 0xFFF > > > >I have INITRM=9 INITEE=1 and INITRG=0 > > > >But i think that there is a pb between adress RAM and adress EEPROM > > > >Thank you very much for your help > > > >Regards |
Reply by ●June 2, 20042004-06-02
Pascal and Bob, You shouldn't have to recompile anything when you move the registers, RAM and EEPROM around. The locations for these registers should be set in the linker directive file. I believe Metrowerks and Cosmic both have libraries that work this way. It necessary to check the startup code, and possibly modify it, but no recompilation of a properly constructed library should be necessary. Hope this helps, Steve Russell Nohau Emulators At 04:12 AM 6/2/2004, Bob Gardner wrote: >In a message dated 6/2/04 7:02:51 AM Eastern Daylight Time, > writes: > >I don't undersant very well wich values should i put in these registers. >My eeprom is at 0x400 to 0x7FF >My RAM 0x800 to 0xFFF > >I have INITRM=9 INITEE=1 and INITRG=0 > >But i think that there is a pb between adress RAM and adress EEPROM >========================================= >Do you use c or assembler? I think the problem is: if you change the >register location (for example), then every function compiled in the c run >time >library that used the old default location is now broken. If you recompile >your >whole library, then you have a new nonstandard incompatible version to be >maintained separately from every other version. Big hassle. ************************************************************************* Steve Russell mailto: Senior Software Design Engineer http://www.nohau.com Nohau Corporation phone: (408)866-1820 ext. 1873 51 East Campbell Avenue fax: (408)378-7869 Campbell, CA 95008 ************************************************************************* |