Daniel Lundin

Register map for S12 C32?

Discussion created by Daniel Lundin on Sep 22, 2008
Latest reply on Sep 23, 2008 by bigmac
I have been using the S12 devices DG128 and C32 for quite a while now. For my C32 projects I have always used the same register map as for my DG128 projects, without problems.

Now I started up a new C32 project with PWM and ATD, parts that I haven't used before for this mcu derivate. I soon discovered that I wouldn't be able to use my old memory map for the D family, since both MODRR and the whole PWM is allocated at different addresses. Ie, S12 processors are not code compatible because of different hardware.

Fair enough, I switch to the register map in the non-standard C header that came with the compiler (CW 3.1). Something in this header file is however fishy, I can't get the ATD working. If I switch back to my old register map, everything works. As far as I know, there shouldn't be any ATD hardware differencies between DG128 and C32, except less silicon bugs in the latter.

I suspect it could be related to "struct padding" or similar compiler options... the CW register map is cluttered with unions and macros, non-standard bitfields and non-standard variable allocation. I'm not too intrigued to track down the cause of the error in that mess.

So I am wondering if there are any known issues with the register map, and if there is a newer register map for C32 available in later versions of CW?

Or even better, is there a register map for this mcu written in pure ANSI/ISO C with #defines?