-
Notifications
You must be signed in to change notification settings - Fork 80
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
atmega32: Add ATmega32 and ATmega324p support. Implement simpler-api branch #138
base: master
Are you sure you want to change the base?
Conversation
… ATmega32 support
…rdize exports around
Thank you very much! A few questions:
|
I would prefer just
I envision something like this: const program = loadHex(MyIntelHexString);
const AVR = createAVR(ATmega324p, { program: program, clockSpeedHz: MHZ });
AVR.gpio['B'].addListener((value, oldValue) => {
console.log(value);
});
AVR.usart[0].onLineTransmit = (value) => {
console.log(value);
};
That's perfectly fine, I was mostly following status-quo to avoid a massive un-reviewable pull request.
Not very extensively yet. Only GPIO, timers, and timer interrupts. I have taken parts of the Arduino core (digital/AnalogRead/Write, Print.cpp, ...) along with the timer vectors and I compiled them using standard |
Thanks James! I like your suggestion. Refactoring Is refactoring The pull request is already massive, but from what I've seen so far you adapted the code style of the project pretty quickly, and the code quality is great. So I wouldn't worry about adding stuff into the PR. Where can I find the standalone library that you created on your end? Ideally, I'd like to be able to reproduce your setup and eventually turn it into a Github action that will run on every push and ensure we have no regressions. |
I'm still reviewing the test code, let me get back to you |
@urish I've taken a comb over the above project and tested everything (gpio output/input/input pullup, analog read, serial read/write) on an actual ATmega324p. So I am confident that the simulator should reflect accurate behavior. Unfortunately my time lately has been focused away from this project. I added a bit more to |
Hello,
This merge adds a first pass at ATmega32 and ATmega324p support.
I did this to expand avr8js's scope a little bit to be a more general-purpose AVR simulator (as other AVR options are old and not as easy to use, mostly in C), as my projects use these chips, and to lay any groundwork for refactoring into allowing adding any new chips to be easier.
Key part of this merge
simpler-api
changes are not exported, I will leave that up to the maintainers (Simpler API? Request for comments #87).I have not: