Dear Crasycat
TBCR is declared in Motorola's HC908GZ60.h like this:
/*** TBCR - Timebase Control Register; 0x0000001C ***/
typedef union {
byte Byte;
struct {
byte :1;
byte TBON :1; /* Timebase Enabled */
byte TBIE :1; /* Timebase Interrupt Enable */
byte TACK :1; /* Timebase ACKnowledge */
byte TBR0 :1; /* Timebase Rate Selection Bit 0 */
byte TBR1 :1; /* Timebase Rate Selection Bit 1 */
byte TBR2 :1; /* Timebase Rate Selection Bit2 */
byte TBIF :1; /* Timebase Interrupt Flag */
} Bits;
struct {
byte :1;
byte :1;
byte :1;
byte :1;
byte grpTBR :3;
byte :1;
} MergedBits;
} TBCRSTR;
extern volatile TBCRSTR _TBCR @0x0000001C;
//#define TBCR _TBCR.Byte
#define TBCR_TBON _TBCR.Bits.TBON
#define TBCR_TBIE _TBCR.Bits.TBIE
#define TBCR_TACK _TBCR.Bits.TACK
#define TBCR_TBR0 _TBCR.Bits.TBR0
#define TBCR_TBR1 _TBCR.Bits.TBR1
#define TBCR_TBR2 _TBCR.Bits.TBR2
#define TBCR_TBIF _TBCR.Bits.TBIF
#define TBCR_TBR _TBCR.MergedBits.grpTBR
#define TBCR_TBON_MASK 2
#define TBCR_TBIE_MASK 4
#define TBCR_TACK_MASK 8
#define TBCR_TBR0_MASK 16
#define TBCR_TBR1_MASK 32
#define TBCR_TBR2_MASK 64
#define TBCR_TBIF_MASK 128
#define TBCR_TBR_MASK 112
#define TBCR_TBR_BITNUM 4
Hello
In fact you need to also add the register definition file (HC908GZ60.c) in your project and link it to the project.
Here you were using a variable, which was declared but not defined ....
CrasyCat
Dear Crasy,
Thanks for your reply. I added the source file into project, however now I get another link error, but I don't know if it has the relation with the above problem. Could you please help?
"Segment LIN_VECTORS (0xFFD0) and .absSeg113 (0xFFFF) overlap"
In the auto-generated master.map, I found this:
.abs_section_ffff 1 N/I 0xFFFF 0xFFFF .absSeg113
How do I adjust to solve the conflict?
Below is the declaration of LIN vectors in vector.c
#define LIN_VECTF (void *const)
void *const _vectab[] =
#endif /* defined(COSMIC08) */
#if defined(HC08GZ60)
/***************************************************************************/
/* HC08GZ60 */
/***************************************************************************/
{
LIN_VECTF Dummy_ISR, /* 0xFFD0 ADC */
LIN_VECTF Dummy_ISR, /* 0xFFD2 IRQ2/Keypad */
LIN_VECTF Int_CAN_Transmit, /* 0xFFD4 SCI transmit */
LIN_VECTF Int_CAN_Receive, /* 0xFFD6 SCI receive */
LIN_VECTF Dummy_ISR, /* 0xFFD8 SCI error */
LIN_VECTF Dummy_ISR, /* 0xFFDA MSCAN Wakeup */
LIN_VECTF RTI_ISR, /* 0xFFDC MSCAN Error */
LIN_VECTF Dummy_ISR, /* 0xFFDE MSCAN Receive */
LIN_VECTF Dummy_ISR, /* 0xFFE0 MSCAN Transmit */
#if defined(MASTER) /* (used for Master node only)*/
LIN_VECTF LIN_ISR_SCI_Transmit, /* 0xFFE2 SCI transmit */
#endif /* defined(MASTER) */
#if defined(SLAVE)
LIN_VECTF Dummy_ISR, /* 0xFFE2 SCI transmit */
#endif /* defined(SLAVE) */
LIN_VECTF LIN_ISR_SCI_Receive, /* 0xFFE4 SCI receive */
LIN_VECTF LIN_ISR_SCI_Error, /* 0xFFE6 SCI error */
LIN_VECTF Dummy_ISR, /* 0xFFE8 TIMER B channel 1 */
LIN_VECTF Dummy_ISR, /* 0xFFEA TIMER B channel 0 */
LIN_VECTF Dummy_ISR, /* 0xFFEC TIMER A overflow */
LIN_VECTF Dummy_ISR, /* 0xFFEE TIMER A channel 3 */
LIN_VECTF Dummy_ISR, /* 0xFFF0 TIMER A channel 2 */
LIN_VECTF Dummy_ISR, /* 0xFFF2 TIMER A channel 1 */
LIN_VECTF Dummy_ISR, /* 0xFFF4 TIMER A channel 0 */
#if defined(MASTER) /* (used for Master node only)*/
LIN_VECTF LIN_ISR_Timer0, /* 0xFFF6 TIMER A channel 0 */
#endif /* defined(MASTER) */
#if defined(SLAVE)
LIN_VECTF Dummy_ISR, /* 0xFFF6 TIMER A channel 0 */
#endif /* defined(SLAVE) */
LIN_VECTF Dummy_ISR, /* 0xFFF8 PLL */
LIN_VECTF Dummy_ISR, /* 0xFFFA IRQ1 */
LIN_VECTF Dummy_ISR, /* 0xFFFC SWI */
LIN_VECTF Node_Startup /* 0xFFFE RESET */
};
Thanks,
Khoa
Dear CrasyCat,
Thank you very much for your answer. I followed your suggestion and it works well now
Best regards,
Khoa