Hi,
I have tried to run some simple models on my S32K148EVB and it seems that the push buttons do nothing.
My model is setup like shows in one of the tutorials:
The light on the board start red and stays red when button is pushed. I have linked to FreeMaster as shown and the button state never actually changes when I press it. Am I doing something obviously wrong?
Thank you!
Hello @Poley ,
The problem might be related to the data variable type of the output port or smth. I've tried with the Data Type Memory and the code seems to work. Another possibility might be the Period in which the freeMaster reads the variable I set 0 basically to read as fast as possible.
I have attached the model and FreeMaster example. Can you please give this a try?
Hope this helps,
Marius
Unfortunately doesn't work.
Here's what I did:
1. Extracted files to new folder
2. Build code using embedded coder
3. Opened FreeMaster 3.1 and loaded the project you linked.
4. Added the .elf to the map option just in case
5. Pressed GO, and value doesn't change from 0 when pressed.
When I probe the switch with a multimeter the voltage doesn't seem to change when pressed either. I thought it could be a faulty SW but it doesn't work SW3 or SW4 on the board
Also to use digital inputs in my model do I always have to have it linked to FreeMaster? Can it not work without?
Thanks for the help!
Hello @Poley ,
The steps you've made are fine. I've measured on my board for the SW3. When the button is not pressed, the PT60 is 0V, when the SW3 is pressed, the PT60 is 5V.
The MCU seems to work on your side because you can connect to the FreeMaster. This is strange, can you please send me the .mot file generated to test it on my board?
For the last question, I am not sure I understand it. FreeMaster only read/write memory variables/regions. When you use FreeMaster to bring that value on your computer, basically it reads the value and sends it over UART to the Desktop application. The data store memory used, makes the process easier because it writes the button state to a volatile variable that is easier to find in the FreeMaster. MCU should read the button state and sent it to the LED even if you are using or not the FreeMaster.
Marius
Hello @Poley
I've tried your example and it works on my board by pressing the SW4, not SW3 as the one in your attached picture.
Let's try to bypass the switch button and put 5V to the output. You can use a write connected to the 5V, as in the attached image below, and TP61(SW4). On my setup, this turned the LED on GREEN
On my setup, the logic seems to be reversed. Normally the LED is turned off, while the button is pressed the LED is lighting up. Curios.
Hope this helps,
Marius
Bypassing the switch works:
I have noticed that when probing the switches I does a tiny amount. It is dead on 0v before pressed and then 6mV when pressed. Could I have faulty switches?
Hi @Poley ,
I would suggested that you should try to build your own pull down button circuit to try this GPIO example
or else try out the ADC example to ensure your freemaster working properly as expected.
Regards
Have you checked the COMPORT baudrate at device manager is that matched with your Simulink LPUART1 baudrate config?. Also you need to import the generated elf on freemaster "options" -> "map". Please ensure this procedure step is done