-
Notifications
You must be signed in to change notification settings - Fork 13
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
Adapting to Arduino Pro Micro 3.3V 8 Mhz #9
Comments
Can the 32u4 act as SPI slave like the 328p? Curious to what choices we have to choose as controller chip. |
I think the Pro Mini is 328P 3.3V and it's very small. |
Reading that thread it seems like that it can not be used as a spi slave out of the box.. |
Yes I saw the Pro Mini as well but as it doesn't have a USB port I thought it would be better to use a different chip, just to keep things as simple as possible. |
Okay I just ordered a Pro Mini 3.3V and will report back in a couple of days when it arrives. I think the Pro Mini will be better compared to the Pro Micro as it uses the same 328 as the nano (as you already said) 😅 |
I think it should work out just fine for you. :) |
Just received the pro mini and uploaded the sketch. Unfortunately the same happens, I connect it to my base and it instantly disconnects and restarts. |
Did some more testing and couldn't make it work 😞 |
I found this : Thus, 8 MHz transfers should not be counted on to work in Slave mode, only in Master mode." posted on arduino forum here https://forum.arduino.cc/index.php?topic=424260.0 (post #3] I was also looking into using a 3,3v arduino for more simple solution, but it seems it won't work. |
Good catch! So 8 MHz is just not enough. After some more digging about running Arduinos at 3v3 and 16 Mhz+ I found the Adafruit Trinket M0. Judging from the specs it doesn't look too bad! 3.3V @48Mhz. (thats 3x the speed of the 328p, is there something like too fast?) About using it as a spi slave I've found this thread which doesn't contain much information unfortunately. |
I've also found this https://flytron.com/multicopter-parts/116-3v-16mhz-pro-mini-with-100-arduino-compatibility-.html , but it's a bit too expensive (for what it is). I've had arduino nano, level shifter and PCB prototype board lying around, so I'll just use that. It's not going to be pretty though ... |
You might want to give the 3.3V arduino another go. I debugged a few things on the SPI communication, it's a lot more reliable now. notice the changes in the diagram (Added Diode, and D2 is connected to D10). the latter is really important for proper SPI communication and may fix the issue that you've had before. |
I will! Thank's for your effort in this project 🚀 Could you tell us a bit more why it's necessary to connect D2 and D10? Is it because of the Slave Select? Edit: Also, is the Diode even needed when running 3.3V? |
:) but I still had a problem where the incoming SPI data was pushed a couple of bits out of alignment. That problem would come and go. So for example the 1st bit of the 1st byte sent by the wheelbase, would sometimes register as the 2nd or 3rd bit of the 1st byte in the arduino, etc. And once that happens - all the packet is corrupted and you have nothing but CRC8 errors. The diode is needed to separate the wheelbase 5V power supply from the computer USB 5V power supply. Any old 0.5A diode should be enough. I believe the one I used is about 3A. |
Thank you very much for that detailed explanation, it's very interesting! I also saw that the button inputs are now working correctly without the delay, that's super handy to build a custom wheel. I will try the 3.3V arduino again and will report back :) |
Sorry for the long delay! I also purchased an Arduino V2 Pro Mini which offers the possibility to run 16 MHz on 3.3V. With that it works in about 3 / 10 cases, which is not that good - but hey at least it works, kind of 😅 I also noticed that the wheelbase thinks the D-Pad button is held down the whole time, did anyone of you experience that as well? I'm not to sure what causes the issues, maybe it's the 16 MHz which aren't officially supported when running 3.3V or it's the long jumper cables connecting the Pro Mini to the Fanatec QR pins. If I find the time I will create a small pcb to make sure the jumper cables are not a problem here and report back! |
- add wheelbase damage warning - add note to uncomment lines - remove connection of 5V to RAW (including diode)
Has somebody tried it again?, I'm currently trying to get it running on my pro Micro but i got similar MISO/MOSI results as you got initially. My wheelbase isnt restarting or anything like this tough. My Wiring is the same apart from 3.3v not being connected. Unfortunately no wheel is recognised by the wheelbase. Is it set that the Processor frequency is not enough or is it just a Atmega328P at 3.3v thing? Has anybody got it working by now? |
I suspect that 8 MHz is not fast enough as I couldn't make it work with a pro micro either. Try to buy a Pro Mini V2 which is able to run 16 MHz at 3.3V and you should be good. |
Oh havent seen that conversation. Will give the Pro Mini V2 a shot and see if that works out for me. Thank you for your investigations! |
I am still using it in this configuration Pro Mini V2 16Mhz 3.3V. Its working flawlessly for me and its the only wheel i use. |
Where can you buy Pro Mini V2's now? |
Hey!
I've tested this code using an Arduino Nano + Level Shifter and it worked like a charm! As I want to design the smallest possible PCB so that it fits into my Fanatec QR Adapter (52mm to 70mm) I want to use a 3.3V powered Arduino so I don't have to use a level shifter which is quite big.
@lshachar stated that he didn't try a 3.3V Arduino yet, because he thinks that it will be a problem later on if we want to use the buttons. As the button functionality isn't yet fully implemented and I'm planning to use something else this won't bother me. I just need the base to think that a Fanatec rim is attached to it! 😅
I only found a few 3.3V powered Arduino's and made my choice for the Pro Micro.
I have changed the
CS_ISR
pin to 3, as pin 3 maps to interrup 0 (INT0) on the board. More info about the board can be obtained here.I've wired everything up and connected it to my base, but it instantly disconnects from my pc and reboots (the rev lights light up and it spins to center itself). So there is definitely something not working as it should.
The strange thing is, if I disconnect pin 4 from the Fanatec QR (5V) and connect the pro micro to my pc via usb to have a look at the serialport, my base does not reconnect if I connect the arduino to it 🤔
The serialport only says that "incoming data crc8 mismatch!" is wrong. I printed the MISO and MOSI buffers and they are:
Just in case, here is my wiring:
4 - RAW
7 - VCC
3 - GND
5 - GND
1 - 14
2 - 16
6 - 15
8 - 3
Here is the pinout of the Pro Micro as found on the Sparkfun Site:
Please let me know if I can do something else to provide more information that could help to solve the issue. Did maybe one of you already try another 3.3V Arduino, if so did it work for you? I'm not fixed with the pro micro!
Thanks!
The text was updated successfully, but these errors were encountered: