Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
3 years, 8 months ago.
X-NUCLEO PLC01A1 + mbed::ticker doesn't work?
I have a Nucleo-F334R8 with a X-NUCLEO PLC01A1 expansion board.
I am currently attempting to use multiple outputs in parallel, through the use of the mbed::Ticker class. I achieved blinking a LED and outputting from the DAC (starts at 0V, increments by 0.1V till 1V and resets to 0), however the PLC addon is giving me trouble.
The PLC's code that I use is a slightly modified version of the HelloWorld_PLC01A1 project. https://developer.mbed.org/teams/ST/code/HelloWorld_PLC01A1/
I have simply added a main.h to my file that contains the function variable/function/class declarations. Stand-alone this works just like the regular Helloworld.
But when combined with the Ticker function it seems to remain stuck at it's starting phase. The red FAULT LED shines. To my understanding it is always on until the first signal is received. When I was experimenting with a push button before, it was on until I pressed the button the first time. In the helloworld it also blinks for a fraction of second before immediately receiving a signal.
note: I've changed the SPI_CLK pin from D13 to D3, because D13 also controls the LED. (see X_NUCLEO_PLC01A1/BSP/x_nucleo_plc01a1_config.h)
note2: I am using the mbed-os version of mbed.h: https://github.com/ARMmbed/mbed-os/
Here is my code:
- main.c: http://pastebin.com/YBiiJeaV
- main.h: http://pastebin.com/5WJkk6Cu
- image of my setup: http://i.imgur.com/iH5c6gQ.jpg
the PLC receives 24V, and should output from OUT1 and OUT8. A 24V relay is connected to OUT1. The relay is tested and works in some other projects I have, so there are no broken components.
I've been struggling with this all day, but I can't figure out what the problem is :( Can anyone help me get this to work?