5

Tried to upload my Arduino Uno sketch that writes to serial UART at 9600 baud rate onto my ATtiny2313 running at 1MHz. Not getting the signal on the ATtiny, does this have to do with my clock frequency of the MCUs being 16 vs 1MHz?

Greenonline
3,1527 gold badges36 silver badges48 bronze badges
asked Nov 20, 2014 at 10:08
1
  • 1
    You'd need to set F_CPU to 1. However the only way to do this is to create a new board inside the hardware folder. Once created it will fix delay, millis and serial. Commented Nov 20, 2014 at 17:06

1 Answer 1

3

Yes, it does. As can be seen in the "USART" section of the datasheet the baud rate is generated directly from both fosc (aka FCPU) and the value contained in UBRR. The tables at the end of the section gives the appropriate value for UBRR for a given CPU frequency, desired bit rate, and state of the USART clock doubler.

answered Nov 20, 2014 at 10:17
2
  • Thank you, where can i find more info on how to get my 16mhz Arduino uno sketch to properly work on Attiny. I guess i must change the FCPU and UBRR? Commented Nov 20, 2014 at 10:33
  • Also would it port better if i used a ATMEGA8 instead of the ATTINY2313. Please let me know if there is any great beginner bookss that will catch me up on becoming an avr expert :) Commented Nov 20, 2014 at 10:49

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.