cancel
Showing results for 
Search instead for 
Did you mean: 

Use of SWIM input as digital I/O

Hi everyone,

I need your kind support for an issue regarding the micro STM8L050J3.

In one of my project for a question of overall dimensions of the PCB (wearable device) I must necessarily use this 8-pin micro, but unfortunately I still need an extra I/O pin.

So I know it is possible to use PA0, that by default is used for SWIM interface, remapping it via firmware after at least 5 seconds from programming, but my question is: how can I verify during debug with ST-LINK/V2, in real time, the functionality of the function used for PA0 mapped dome digital input with Pul-Up without creating conflicts?

Is it possible? 

And if yes, in which way?

Thanks a lot for any of Your relpy,

Sisto Zànier

2 REPLIES 2
Artur IWANICKI
ST Employee

Hello,

It will be not possible to use SWIM line as GPIO within debug. Either it will be SWIM line and you can do effective debug or you use it as input with pull-up.

The solution could be to use UART as an interface sending "debug information".

Best Regards,

Artur

Artur, thank you for your response.

Obviously during debug the pin PA0 will be used as SWIM input, but as you can see from the attached schematic, during normal operation, then NOT in DEBUG, I need to use PA0 as Digital-Input with internal Pull-Up (about 60K) to detect the status of the jumper JM1 that is always normally open during Debug.

From the technical specifications of the micro STM8L050J3M3, I understand that this is possible, but I did not understand how. 

That is, the goal is that at the next POR after programming the micro, PA0 is configured as Digital-Input, but I did not understand if this happens automatically 5 seconds after the POR, or if it is necessary to configure it from the firmware.

Best Regards,

Sisto

0693W00000Hot8mQAB.jpg