Hello,
I'm not very experienced with embedded systems, and currently I'm working on a project that uses a Teensy 4.0 and the following 3 libraries:
https://github.com/tsandmann/freertos-teensy
https://github.com/pedvide/ADC/blob/master/ADC.h
https://github.com/tonton81/FlexCAN_T4
I am planning to move to a Teensy 4.1 but currently the one I have is broken so I am testing on the 4.0.
The isolated parts that seem to work so far are reading from 16 input values using both ADCs, and sending a message on the CAN bus.
I am trying to connect the two parts so I can propagate the input values on the CAN bus.
The ADC readings are implemented in a non-blocking way that uses an IntervalTimer to trigger a read of the first pin, and when the read completes, the ISR starts a read for the next pin, etc, until all pins are done. This runs on a xTaskCreate thread from freeRTOS.
When I first tried merging the two components of the project, I was getting issues when compiling the libraries, like HEX not being recognized as a macro, and constrain not being defined. After some workaround like replacing HEX with 16 and redefining constrain in the file where it was not found, I was able to get the code compiling, but when I upload it to the Teensy, the orange button keeps blinking and I get no serial output.
I am thinking this could be an issue arising from the ADC interrupt-based approach interfering with the interrupt handling from the CAN library, but I'm not super sure since I do not fully understand how interrupts are currently implemented in both libraries and what extra steps I would need to take to make them compatible.
Does anyone have experience with this or have any ideas on steps I could take to combine these?
Thanks in advance
I'm not very experienced with embedded systems, and currently I'm working on a project that uses a Teensy 4.0 and the following 3 libraries:
https://github.com/tsandmann/freertos-teensy
https://github.com/pedvide/ADC/blob/master/ADC.h
https://github.com/tonton81/FlexCAN_T4
I am planning to move to a Teensy 4.1 but currently the one I have is broken so I am testing on the 4.0.
The isolated parts that seem to work so far are reading from 16 input values using both ADCs, and sending a message on the CAN bus.
I am trying to connect the two parts so I can propagate the input values on the CAN bus.
The ADC readings are implemented in a non-blocking way that uses an IntervalTimer to trigger a read of the first pin, and when the read completes, the ISR starts a read for the next pin, etc, until all pins are done. This runs on a xTaskCreate thread from freeRTOS.
When I first tried merging the two components of the project, I was getting issues when compiling the libraries, like HEX not being recognized as a macro, and constrain not being defined. After some workaround like replacing HEX with 16 and redefining constrain in the file where it was not found, I was able to get the code compiling, but when I upload it to the Teensy, the orange button keeps blinking and I get no serial output.
I am thinking this could be an issue arising from the ADC interrupt-based approach interfering with the interrupt handling from the CAN library, but I'm not super sure since I do not fully understand how interrupts are currently implemented in both libraries and what extra steps I would need to take to make them compatible.
Does anyone have experience with this or have any ideas on steps I could take to combine these?
Thanks in advance