-
Notifications
You must be signed in to change notification settings - Fork 247
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
Arduino Nano flashed with internal 8mhz - Serial Problems #322
Comments
The problem is that the internal oscillator isn't very accurate, and would need calibration in order to work. For this you'll have to use the OSCCAL = OSCCAL - 10;
while(OSCCAL < 0x7F) {
OSCCAL++;
Serial.printf("New OSCCAL value is 0x%02x\n", OSCCAL);
delay(1000);
} At the start of every program you'll have to write the correct value to the OSCCAL register: |
Thank you so much I solved it! Thanks again! void setup() {
delay(1000);
Serial.begin(1200);
delay(1000);
uint8_t original_osccal = OSCCAL;
uint8_t start_value = original_osccal - 20;
for(uint8_t i = 0; i < 40; i++) { // Test di 40 valori
uint8_t test_value = start_value + i;
OSCCAL = test_value;
delay(1000);
for(int j = 0; j < 5; j++) {
Serial.write('=');
}
Serial.write(' ');
Serial.write('0' + (test_value / 100));
Serial.write('0' + ((test_value / 10) % 10));
Serial.write('0' + (test_value % 10));
Serial.write(' ');
for(int j = 0; j < 5; j++) {
Serial.write('=');
}
Serial.write('\n');
}
OSCCAL = original_osccal;
}
void loop() {
} |
Great to hear you figured it out! |
Hi, I used the MiniCore boards to flash the bootloader version that provides 8mhz internally on an Arduino Nano.
I flashed using an Arduino UNO connected via ISP to the Arduino Nano that hosts the new bootloader. Everything happened correctly also because with some tools I read the Fuse bits setting and they are like this:
The crucial point is that I'm having big problems with the Serial. In fact, even if I try different baud rates of 9600 or 4800 etc., unfortunately the Serial prints strange characters as if there was a discrepancy between the two speeds of the microcontroller and the serial monitor, even though they are set the same for both. Obviously when I load a sketch, I set "ATMEGA328" as the board and "Internal 8Mhz" as the clock. I leave the Baudrate "few" (in italian appears "pochi") even if I tried to change it without solving anything.
How could this problem be solved? Thanks.
The text was updated successfully, but these errors were encountered: