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

Add atmega328p-hal & arduino-uno support #3

Merged
merged 9 commits into from Jun 27, 2019
Merged

Conversation

jonahbron
Copy link
Contributor

@jonahbron jonahbron commented Jun 24, 2019

Created a new crate for atmega328p, copied the code over and updated the list of GPIO pinouts and updated the specific pins used for USART and TWI.

@Rahix
Copy link
Owner

Rahix commented Jun 25, 2019

Please also port the examples from leonardo and make sure they work. If you need any help, please don't hesitate to ask!

@Rahix
Copy link
Owner

Rahix commented Jun 25, 2019

Just as a heads up: For the leonardo-panic (and thus for the uno-panic example you'll add) to work, you need to use my latest master branch which contains cab8613.

@jonahbron
Copy link
Contributor Author

jonahbron commented Jun 26, 2019

Yeeeeeaaaaahhhhhhhhh bbbooiiiiiiiiiiiiiiiiiiii

First try, the blink example works on my Uno. 😄

@jonahbron
Copy link
Contributor Author

jonahbron commented Jun 26, 2019

@Rahix The blink, serial, and panic examples have been ported and tested. I don't have any hardware with which to test I2C example however. Are you willing to consider this completed without that example?

Copy link
Owner

@Rahix Rahix left a comment

Yeeeeeaaaaahhhhhhhhh bbbooiiiiiiiiiiiiiiiiiiii

First try, the blink example works on my Uno.

Heh, I know that feeling all to well ;) Makes all the hard work worth it!


Thank you very much for your port! I have added a few comments, once those are resolved I am happy to merge.

Are you willing to consider this completed without that example?

Please add the i2cdetect example and at least check that it reports an empty bus. I might have access to some ATmega328P based hardware soon, I will test it in detail then.

boards/arduino-uno/src/pins.rs Show resolved Hide resolved
boards/arduino-uno/examples/uno-blink.rs Outdated Show resolved Hide resolved
boards/arduino-uno/src/lib.rs Show resolved Hide resolved
@jonahbron
Copy link
Contributor Author

jonahbron commented Jun 26, 2019

Thanks for the review @Rahix . I'll try to work on those items tonight (Central Standard Time).

@jonahbron
Copy link
Contributor Author

jonahbron commented Jun 27, 2019

@Rahix All of your requested changes are complete, and the i2cdetect example has been ported. To confirm, is this the expected serial output?

Write direction test:
-    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:       -- -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Read direction test:
-    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:       -- -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

@Rahix Rahix self-requested a review Jun 27, 2019
Rahix
Rahix approved these changes Jun 27, 2019
Copy link
Owner

@Rahix Rahix left a comment

Perfect! The i2cdetect detect output also looks like it should. I will try to test it against some actual bus soon, though I don't expect any surprises there.

Thank you very much for your work on this! 😃

@Rahix Rahix changed the title Added ATmega328P chip support based on modifying the ATmega32u4 chip code Add atmega328p-hal & arduino-uno support Jun 27, 2019
@Rahix Rahix merged commit 1e1ed1b into Rahix:master Jun 27, 2019
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.

None yet

2 participants