Comments (6)
The Uno is using a 16 Mhz crystal, and using a 16 Mhz crystal on an AVR causes for example the frequencies 57.6 kbit and 115.2 kbit to be outside of the 1% error normally needed for an UART.
I normally recommend to be below 0.5% error.
To be able to select a good bit rate the Wormfood AVR bit rate calculator is a nice tool.
To get 57.6 kbit below 1% error, U2Xn must be set to 1. It is still above 0.5% so it might not work. 115.2 kbit is not working at all.
from avr-hal.
(And off-topic: Are you at 37c3 by any chance? :D)
from avr-hal.
Hm, I was even able to get 115200 baud working okay in the past IIRC so I'd expect this to not be too bad. What board and MCU are you using here?
I think there is a second issue here: ravedude
shouldn't crash in such situations. We either need to simply remove the unwrap()
here: https://github.com/Rahix/avr-hal/blob/f6b79dccbb36808b06f9c5d3e0050dc72ccc25cf/ravedude/src/console.rs#L34C20-L34C20 or implement some sort of input sanitization to ensure we only output correct UTF-8...
from avr-hal.
What board and MCU are you using here?
i'm using some obscure arduino uno clone called gscheiduino (the manufacturer is also discontinuing it, so i wouldn't recommend it to anyone 😉) which i got from university (i think due to supply chain issues they couldn't get the real arduino unos at the time) running with an atmega328p.
so yeah, maybe this is just an issue of this board?
(And off-topic: Are you at 37c3 by any chance? :D)
no, but i wish you a lot of fun there! 😄
from avr-hal.
Hmm, so there is this ugly ugly hack that's needed on some boards to get certain serial baudrates working correctly. Maybe you're hitting some version of that? The code is this one:
avr-hal/avr-hal-generic/src/usart.rs
Lines 130 to 140 in f6b79dc
from avr-hal.
Hmm, so there is this ugly ugly hack that's needed on some boards to get certain serial baudrates working correctly. Maybe you're hitting some version of that?
no clue. but if i'm the only one reporting this i'm happy to just ignore it. i'm just playing around a bit with this device, so i don't care if it doesn't run with higher baud rates. i have no intention of using it for anything more serious.
from avr-hal.
Related Issues (20)
- Refactor most or all macros using `paste` to replace identifier-passing
- generic spi? HOT 3
- Arduino UNO R4 WiFi Support? `Error: no matching serial port found` HOT 2
- core::fmt::write! causes unexpected behavior HOT 3
- ravedudes default config doesn't include correct signature for Atmega328PB
- `[email protected]` roadmap? HOT 1
- async serial HOT 9
- roadmap to stable rust HOT 5
- Linker errors when compiling for atmega328p with more than one instance of libm::atan referenced in a given function HOT 10
- add easy way to build the whole workspace HOT 2
- don't use atmega328p spec for atmega328pb it can lead to catastrophic UB
- No way to switch an analog pin back to digital mode HOT 7
- The crates' avrdude.config not compatible with AVRDUDE 7.1 HOT 1
- "uno-timer" example no longer works HOT 8
- Critical section causes unexpected behaviour in `--release` mode HOT 10
- avrdude 7.3 cannot find programmer HOT 3
- `cargo run` fails - avrdude looking for missing "system wide configuration file" HOT 13
- Arduino Uno readDigital equivalent
- Can't write to serial HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avr-hal.