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

Support ESP v2+ chip feature to divide BRP by 2 #71

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mister0wl
Copy link

This code is a little rough, I think the best would be to calculate BRP and compare if it's too big then use the divider. But in the original codes the values of BTR0 and BTR1 is pre-calculated so I thought for first approach it fits. I could not test 20kbps so I can't be 100% confident that the values are correct.

Copy link

@henryfabricio henryfabricio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//Changing bit using modifyregister is not correct on line 130, you need to change BRP_DIV_EN_BIT (bit 4). Suggestion:
#define BRP_DIV_EN_BIT 0x10
modifyRegister(REG_IER, BRP_DIV_EN_BIT, BRP_DIV_EN_BIT); // From rev2 used as "divide BRP by 2"

src/ESP32SJA1000.cpp Outdated Show resolved Hide resolved
@tzzee
Copy link

tzzee commented Jun 20, 2022

I think REG_IER is overwrite 0xFF by writeRegister
I send @mister0wl a pull request

fix: prevent REG_IER from being overwritten
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.

3 participants