2024-04-01 12:12 AM
Hello all,
I'm Ali, new to ST Microcontrollers, and I'm seeking some guidance to get started with SPC5 Studio. Previously, I developed custom SDKs where I had control over registers, their addresses, and more. However, transitioning to SPC5 Studio has proven challenging for me.
While I can easily import samples from the application library and run them on my microcontroller, I'm struggling with writing a simple LED blinking program. Understanding the schematic, identifying pins, ports, and other details has been particularly difficult.
Currently, I've created a project and set pin 1 as GPIO using pinMap editor, but I'm unsure how to proceed further. If anyone could provide assistance in getting started with SPC5 Studio, including basic programming instructions, it would be greatly appreciated.
For reference, I'm using the AEK-MCU-C1MLT1 board.
Best regards,
Ali
Solved! Go to Solution.
2024-04-01 11:36 AM
Hi Ali,
Let us start with AutoDevKit Studio.
You do not need to install on SPC5Studio as it was before. Just download it and run the .exe to install it:
Eventually, you can also deinstall SPC5Studio.
After installation of AutoDevKit Studio 2.2.1, you need to update some components.
Just go in menu Help>Install new software and write the sever address:
autodevkit.spc5studio.com
Select all and proceed with the installation. Once completed it will ask you to restart AutoDevKit Studio.
After the installation if you click on the 'already installed' link shown in cyan in the previous image you should see the latest installation AutoDevKit group feature version 2.3.1
Now considering the MCU board you have the key low-level drivers primitives you need are:
/* Turn off the first led of the MCU board .*/
pal_lld_setpad(x,y);
/* Delay execution for given milliseconds*/
osalThreadDelayMilliseconds(number_of_millisenconds);
/* Turn on the first led of the MCU board .*/
pal_lld_clearpad(x,y));
/* Delay execution for given milliseconds*/
osalThreadDelayMilliseconds(number_of_millisenconds);
The pin configuration for a given example is:
These 4 functions in an infinite loop will toggle the LED of the board continuously.
An alternative example code to toggle three LEDs follows:
If you want to do it on button press, you should enable the WakeUP unit and set a callback to be invoked every time the button is pressed.
A configuration example below:
Then in the code you need to define the callback function outside the main function, called SetAutomaticOrManualMode() in the above case, and in the main code you should initialize the wakeup unit with the following command:
The second parameter is the name of the configuration you have chosen.
The Interrupt pin in the example above is configured with:
Finally, regarding the LED example in the tutorial video, it involves the AEK-LED-21DISM1 board, a proper LED string driver board.
Best Regards,
AutoDevKit Team
2024-04-01 12:59 AM
Hi,
Try to have a look to intro videos from 2 to 7
https://www.youtube.com/watch?v=pQeyJQBHV1c&list=PLnMKNibPkDnEju3j_qhe-MFK-NnwD_kuP&index=2
Best Regards,
AutoDevKit Team
2024-04-01 01:07 AM
Hi,
Thank you for your response! I've already watched those videos, and while they are helpful, they seem to be using an LED driver that I'm unable to locate. Additionally, I'm having trouble finding the AutoDevKit they install on the SPC5 Studio.
Although the video content is quite informative, my primary goal is to write a simple application code where I can control GPIO to turn on the LED, similar to what we can do in Arduino or other platforms with code like:
Your assistance is greatly appreciated.
Best regards, Ali
2024-04-01 11:36 AM
Hi Ali,
Let us start with AutoDevKit Studio.
You do not need to install on SPC5Studio as it was before. Just download it and run the .exe to install it:
Eventually, you can also deinstall SPC5Studio.
After installation of AutoDevKit Studio 2.2.1, you need to update some components.
Just go in menu Help>Install new software and write the sever address:
autodevkit.spc5studio.com
Select all and proceed with the installation. Once completed it will ask you to restart AutoDevKit Studio.
After the installation if you click on the 'already installed' link shown in cyan in the previous image you should see the latest installation AutoDevKit group feature version 2.3.1
Now considering the MCU board you have the key low-level drivers primitives you need are:
/* Turn off the first led of the MCU board .*/
pal_lld_setpad(x,y);
/* Delay execution for given milliseconds*/
osalThreadDelayMilliseconds(number_of_millisenconds);
/* Turn on the first led of the MCU board .*/
pal_lld_clearpad(x,y));
/* Delay execution for given milliseconds*/
osalThreadDelayMilliseconds(number_of_millisenconds);
The pin configuration for a given example is:
These 4 functions in an infinite loop will toggle the LED of the board continuously.
An alternative example code to toggle three LEDs follows:
If you want to do it on button press, you should enable the WakeUP unit and set a callback to be invoked every time the button is pressed.
A configuration example below:
Then in the code you need to define the callback function outside the main function, called SetAutomaticOrManualMode() in the above case, and in the main code you should initialize the wakeup unit with the following command:
The second parameter is the name of the configuration you have chosen.
The Interrupt pin in the example above is configured with:
Finally, regarding the LED example in the tutorial video, it involves the AEK-LED-21DISM1 board, a proper LED string driver board.
Best Regards,
AutoDevKit Team
2024-04-01 10:59 PM
Hello Max,
Thank you for your detailed explanation and code examples. I really appreciate the effort you've put in to help me understand the process of configuring pins and controlling LEDs on this board.
After reviewing your instructions and the code, I followed the steps to configure pins 48, 53, and 55 as outputs using the "eMIOS_0U16 (eMIOS 0 channel 16)" option in the pin map editor. However, I'm still not seeing the LEDs blink when running the code. I've double-checked the board.h file, and the PORT numbers (PORT_E, PORT_A, and PORT_D) match the ones you provided.
If you don't mind, could you please review the attached screenshot of my pin configuration in the pin map editor? I want to ensure that I've set everything up correctly.
Additionally, if it's not too much trouble, I would greatly appreciate it if you could provide an example of how to configure a button input and the corresponding code for handling button press events. I understand that this might be considered a basic task for professionals like yourself, but as a newcomer to this field, your guidance is invaluable.
Thank you again for your patience and for taking the time to support learners like me. Your efforts are truly appreciated and will undoubtedly benefit not only me but also others who are starting their journey in embedded systems development.
Best regards,
Ali
2024-08-19 05:05 AM
Can you help me with the update site ?
autodevkit.spc5studio.com
I am using SPC5Studio and I go to Help-> Install new Software, and then enter the above address but I get no results.
I tried to open the above link in a browser, the page doesn't load. I tried other update websites and even they don't work such as http://download.spc5studio.com/updates6/
. Except E-Git which started working after I installed a older version.
2024-08-26 01:33 AM