Pro Micro and the Hackster.io Analog Read w/Blink... #9
Replies: 6 comments
-
What happens if you leave out the As background, the Leonardo and Micro (32u4) family with the integrated USB interface impose a significant background processing load on the AVR platform, related to keeping the USB interface alive. There is exact ms timing required on responses on USB, so (any) Libraries that disable the global Interrupt on these devices can have issues. The Arduino IDE disguises this background USB processing from the user. I suggest that the following is happening. Since the 32u4 is running a background timer interrupt (with further interrupts disabled during servicing) to respond to 1ms USB messages on the Serial port, and you've called Serial within a Task (which disables interrupts during the Scheduler activity) the two items are deadlocking. By deadlock I mean that the 32u4 needs to respond to USB messages to keep the interface alive, but the Scheduler is running too and therefore the USB interrupt cannot be serviced in a timely manner, and therefore the Serial interface is never established, ensuring that the As a work around, try setting up the Serial communications in the setup() function. This is before the FreeRTOS Scheduler is enabled, so the conflict will never occur. Also, don't hammer the Serial() command so hard while the Scheduler is running, by using a delay in your
|
Beta Was this translation helpful? Give feedback.
-
I didn't have the
But I am confused about the Which is a believe why this error, now occurs:
|
Beta Was this translation helpful? Give feedback.
-
Yes. Before the Scheduler is started (with the hidden code between Before the Scheduler is started (which happens after the end of |
Beta Was this translation helpful? Give feedback.
-
Alright, some progress.
Now I do get serial I am kinda of curious, since these 32u4 boards are supported by FreeRTOS as well as this project, were there tests run to make sure this code ran on these boards? |
Beta Was this translation helpful? Give feedback.
-
You may need to refer to the LED as The 32u4 is a normal ATmega MCU, and the FreeRTOS port is running successfully. The issue, which applies to everything in the Arduino world, is working around what the IDE does for you and to you to try to make things "easy". The FreeRTOS Library works around lots of Arduino IDE created capabilities (restrictions), but can't work around the fact that the ATmega MCU only has one interrupt priority. |
Beta Was this translation helpful? Give feedback.
-
Heh, I was also, just about to post, everything works fine on my Leonardo and Micro, then I realized the pins for the LEDs on the Pro Micro are designated RXLED and TXLED. So, with that last modification, they are working normally now. One interesting point, is that the LEDs do not blink unless you are watching the serial monitor. Weird. Thank you for your help, it is much appreciated! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have been trying various times to get the Pro Micro to use the code for FreeRTOS on this page:
(https://www.hackster.io/feilipu/using-freertos-multi-tasking-in-arduino-ebc3cc)
After some instruction from Phillip, I have modified some of the code:
Namely adding the
while (!Serial);
towards the end of the sketch.Which now allows it to compile and upload, but the board does not send anything over serial and does not blink the LED.
This is where I am right now and request further help.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions