Skip to content
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

revise delay timing #34

Merged
merged 3 commits into from
Jul 30, 2020
Merged

revise delay timing #34

merged 3 commits into from
Jul 30, 2020

Conversation

jg1uaa
Copy link
Contributor

@jg1uaa jg1uaa commented Jul 28, 2020

for details see (closed) pull request #29
base repository is changed from new-software-serial-timings to master

some LGT8x instructions are faster than original AVR's.
especially PUSH/POP/RET/LD/LDD/ST/STD/RJMP take 1 clock, it needs
re-calculate delay value.

_delay_loop_2() and tunedDelay() added always_inline attribute.
This is disadvantage for memory usage but no need to worry about
calculating CALL/RET clock cycle.

under my brief testing, the result of previous code was

230400bps Rx failed @ 8MHz, TRx failed @ 4MHz
115200bps                    Rx failed @ 4MHz

but now

230400bps TRx failed @ 8MHz,  Rx failed @ 4MHz
115200bps                    TRx failed @ 4MHz

anyway 115200bps and higher transfer rate is not recommended for
8MHz and under CPU clock.
there is a bit difference among gcc-7.3.0, gcc-5.4.0 and gcc-4.9.2
but almost same on receiving. so _rx_delay_xxyyzz does not depend by
compiler version.

on the other hand, _tx_delay value is prepared for gcc-7.0 (and later),
and previous compiler.
@dbuezas dbuezas merged commit ee4f7c3 into dbuezas:master Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants