-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USART.h header file does not work #25
Comments
See note on page 18 about Atmel Studio and the need to define |
Page 18 of which? |
p 18 of the book, Make: AVR Programming |
The following error occurs.
|
Can you explain in detail? |
Can you explain in detail? |
Can you explain in detail? |
The code sets FCPU = 12 MHz. (What?) But then you're using Studio, which maybe ignores this value anyway. I have not kept up with Studio in the last few (5?) years, so I'm unable to help there, but the error really looks like you're not defining FCPU on the right page in the project's settings. |
hey @naveengautam002 first of all remove F_CPU 12000000UL from your main code and #define F_CPU 1000000 UL in USART.c. |
/*
A simple test of serial-port functionality.
Takes in a character at a time and sends it right back out,
displaying the ASCII value on the LEDs.
*/
// ------- Preamble -------- //
#define F_CPU 12000000UL
#include <avr/io.h>
#include <util/delay.h>
#include "pinDefines.h"
#include "USART.h"
int main(void) {
char serialCharacter;
// -------- Inits --------- //
LED_DDR = 0xff; /* set up LEDs for output /
initUSART();
printString("Hello World!\r\n"); / to test */
// ------ Event loop ------ //
while (1) {
} /* End event loop */
return 0;
}
ERRORS
error "recipe for target 'USART.o' failed "
error "F_CPU must be a constant value"
error "setbaud.h requires F_CPU to be defined"
#warning "UBRR value overflow" [-Wcpp]
error "F_CPU' undeclared (first use in this function)"
each undeclared identifier is reported only once for each function it appears in
Severity Code Description Project File Line
Error "recipe for target 'USART.o' failed"
using ATMEL STUDIO 7.0.
The text was updated successfully, but these errors were encountered: