MC68HC11E20 to MC9S12A32 migration, DIRECT memory access

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC68HC11E20 to MC9S12A32 migration, DIRECT memory access

862 Views
micmed
Contributor I

Hello,

 

I am porting some code from a 68HC11 to a 9S12A32, there are some variables that were originally stored in the direct portion of RAM in the 68HC11 and as such the code expects the MSB to be 0x00, however on the 9S12 I allocated RAM to start at 0x1000, is there any way I can make this work as elegantly as possible?

 

Thanks!

0 Kudos
Reply
2 Replies

809 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

additional info.... https://www.nxp.com/docs/en/application-note/AN2881.pdf

 

Keep in mind that they are ... Write: Once in Normal mode. 

Plus, your project can do some automatic initialization based on environment setup and prm file. It is worth to step through entire code to be sure you access what you want to access.
Remapping always expects more focused approach to partial debugging to fully understand where I write and what i read.

Best regards,

Ladislav

0 Kudos
Reply

818 Views
kef2
Senior Contributor V

You may use MMC INITRM and INITRG registers to remap registers out of direct addressing space and move RAM to 0 address. But benefits of this are miserable. Different timing, different instruction encoding, denser code on S12. Do you really need it?

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2354792%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EMC68HC11E20%20to%20MC9S12A32%20migration%2C%20DIRECT%20memory%20access%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2354792%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EI%20am%20porting%20some%20code%20from%20a%2068HC11%20to%20a%209S12A32%2C%20there%20are%20some%20variables%20that%20were%20originally%20stored%20in%20the%20direct%20portion%20of%20RAM%20in%20the%2068HC11%20and%20as%20such%20the%20code%20expects%20the%20MSB%20to%20be%200x00%2C%20however%20on%20the%209S12%20I%20allocated%20RAM%20to%20start%20at%200x1000%2C%20is%20there%20any%20way%20I%20can%20make%20this%20work%20as%20elegantly%20as%20possible%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2355266%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MC68HC11E20%20to%20MC9S12A32%20migration%2C%20DIRECT%20memory%20access%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2355266%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3Eadditional%20info....%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN2881.pdf%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN2881.pdf%3C%2FA%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EKeep%20in%20mind%20that%20they%20are%20...%20Write%3A%20Once%20in%20Normal%20mode.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlus%2C%20your%20project%20can%20do%20some%20automatic%20initialization%20based%20on%20environment%20setup%20and%20prm%20file.%20It%20is%20worth%20to%20step%20through%20entire%20code%20to%20be%20sure%20you%20access%20what%20you%20want%20to%20access.%3CBR%20%2F%3ERemapping%20always%20expects%20more%20focused%20approach%20to%20partial%20debugging%20to%20fully%20understand%20where%20I%20write%20and%20what%20i%20read.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3C%2FP%3E%0A%3CP%3ELadislav%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2355158%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MC68HC11E20%20to%20MC9S12A32%20migration%2C%20DIRECT%20memory%20access%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2355158%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EYou%20may%20use%20MMC%20INITRM%20and%20INITRG%20registers%20to%20remap%20registers%20out%20of%20direct%20addressing%20space%20and%20move%20RAM%20to%200%20address.%20But%20benefits%20of%20this%20are%20miserable.%20Different%20timing%2C%20different%20instruction%20encoding%2C%20denser%20code%20on%20S12.%20Do%20you%20really%20need%20it%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E