ajmartin01
- Feb 19, 2023
- 4
- Joined
- Feb 19, 2023
- Messages
- 4
I just started using the MSP430 series micro-controller, using TI code composer as the IDE. Simple programs work fine "blink, toggle and stuff" But if I try to use anything involving timing I get F_CPU undefined error. here is a small piece of code that gets 2 errors.
# define F_CPU 1000000UL
# include <util/delay.h>
# include <mps430>
int Control = 0;
int main(void) {
/*** Watchdog timer and clock Set-Up ***/
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
DCOCTL = 0; // Select lowest DCOx and MODx
BCSCTL1 = CALBC1_1MHZ; // Set range
DCOCTL = CALDCO_1MHZ; // Set DCO step + modulation
and the errors:
line 11: error #20: identifier "F_CPU" is undefined
line 15: error #20: identifier "DC0CTL" is undefined
Really new to the MPS environment, I think I may need to set something somewhere in the project or compiler but I cant find any thing. Any ideas?
Alan
# define F_CPU 1000000UL
# include <util/delay.h>
# include <mps430>
int Control = 0;
int main(void) {
/*** Watchdog timer and clock Set-Up ***/
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
DCOCTL = 0; // Select lowest DCOx and MODx
BCSCTL1 = CALBC1_1MHZ; // Set range
DCOCTL = CALDCO_1MHZ; // Set DCO step + modulation
and the errors:
line 11: error #20: identifier "F_CPU" is undefined
line 15: error #20: identifier "DC0CTL" is undefined
Really new to the MPS environment, I think I may need to set something somewhere in the project or compiler but I cant find any thing. Any ideas?
Alan