Hi Jasmin,
About SCI baudrate)
Please be careful, early S12ZVM masksets (N06E) contained SCIv5 instead SCIv6. The main difference is in divider by 16 on input clock (SCIv6 don’t have divider) and appropriate changes in registers.
Please look at "..\AN4723_SW\Software\Sources\Comms\" and select appropriate SCI code. Unfortunately example code use SCIv5 be default (Application note was tested and released prior official S12ZVM release)
Early S12ZVM masksets (N06E) have also GDU registers on different place in memory map.
So, please be sure that you use correct header file for your MCU.
I would like to really recommend use separate vector tables for application and bootloader. Typically we want that bootloader could be used more than once. Rewriting default vector location isn’t best idea, because bootloader functionality may be affected.
There is also high risk during reprogramming last sector. If we want update default vector location, we have to erase last sector and unexpected reset (like power supply lost) may cause loosing of information in reset vector – only way how to fix it is trough special mode and BDM interface!
You could create your own vector table in application. For example (based on code generated be PE):
//==============================================================================
// API_ISR
//==============================================================================
interrupt void API_ISR(void)
{
CPMUAPICTL_APIF = 1; //clear flag
}
//==============================================================================
// Unimplemented_ISR
//==============================================================================
interrupt void Unimplemented_ISR(void)
{
asm NOP; //place breakpoint here
}
/* ISR prototype */
typedef void (*const tIsrFunc)(void);
/* Pack 3 byte pointers as 4 byte Interrupt Vector Table entries */
typedef struct
{
byte padding;
tIsrFunc address;
} InterruptTableEntry;
#define _VECTOR(v) {0xFFU, &v}
const InterruptTableEntry _InterruptVectorTable[123] @0x00FFF610U = { /* Interrupt vector table */
_VECTOR(Unimplemented_ISR),
//...
_VECTOR(API_ISR),
//...
_VECTOR(Unimplemented_ISR),
};
I hope it helps you.
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------