Author Topic: $0.11 PY32F002A: Cortex-M0+ MCU, actually a PY32F030! 32/4KB, 48MHz, PLL, DMA...  (Read 98368 times)

0 Members and 1 Guest are viewing this topic.

Offline DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 6571
  • Country: es
Try interrupt instead?
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline andrvisht

  • Newbie
  • Posts: 8
  • Country: ua
It works by interrupt.
Moreover, setting or resetting the bit
Code: [Select]
EXTI->IMR = EXTI_IMR_IM19;does not affect its behavior in any way.
And I can't understand this either...  |O

Since RTC has a separate vector, what does channel 19 EXTI control?
And if this is it, then why the interrupt enable bit
Code: [Select]
RTC->CRH = RTC_CRH_ALRIE;
Well, the main question is how to configure by event ...

PS:

Can someone explain how NVIC is arranged in the event area?

From the description of the core, we can conclude that there is one event input, which probably comes from the EXTI controller.
And then the 19th line of the RTC should be connected to it.
But what is this line ....
It is mentioned only in the description of EXTI, there is not a word about this line in the RTC module itself.
There are no explanations in the figure either.
But, what is interesting ... after all, WFE expects an event bit.
This bit, apparently, is set after the execution of the ISR, or in the presence of an external event.
The problem is apparently that this line either does not exist, or it is prohibited.
This means that there are some conditions under which it passes from the RTC to the kernel event line ...

For now such thoughts...
« Last Edit: February 13, 2025, 05:26:37 pm by andrvisht »
 

Offline DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 6571
  • Country: es
« Last Edit: February 13, 2025, 08:58:41 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline andrvisht

  • Newbie
  • Posts: 8
  • Country: ua
This is a good example, and I checked the operation with the button.
The point is that with GPIO everything works correctly,
but the EXTI lines for GPIO have their own handlers in NVIC.

And in the case of RTC and LPTIM, the handlers have their own dedicated addresses,
and the lines 19 and 29 themselves go to God knows where.
Since there is no handler for these channels.

And in the case of RTC and LPTIM, if their interrupts are disabled, then the events are not issued,
or do not get where they should :)

And since the state of bits 19 and 29 IMR does not affect the operation of the interrupt handler, I assume that it wakes up not from these channels at all, but from NVIC.
 

Offline DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 6571
  • Country: es
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline andrvisht

  • Newbie
  • Posts: 8
  • Country: ua
Yeah, thanks.
I have a similar selection, but earlier versions.
At the moment I managed to get the RTC to react to the event, but for this I need to disable the interrupt itself in NVIC.
Probably the signal which according to the manual is called direct connection is an interrupt signal.
As for IMR, these bits still do nothing.
In addition, the role of the SAVEOPEND bit in the kernel is still unclear.
I continue to investigate.
 

Offline DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 6571
  • Country: es
I'd check the ARM M0+ core docs, that part is almost never described in RMs or datasheets.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline andrvisht

  • Newbie
  • Posts: 8
  • Country: ua
results of my experiments.
In order for channels 29 and 19 to be connected to EXTI, you need to set the interrupt enable bits for these modules.
Then, the enable is controlled by EMR and IMR.
regarding SEVONPEND:
setting it will allow waking up even from disabled interrupts of NVIC channels, provided that WFE is used.
In this case, you need to monitor the reset of the flags of these channels manually NVIC_ClearPendingIRQ(), since only the transition from 0 to 1 of this bit initiates the wake-up event.
The functionality itself is rather questionable, it would be easier to configure it by event, but ... as it is.
Thanks for your help.
 
The following users thanked this post: DavidAlfa

Offline gerbay

  • Contributor
  • Posts: 29
  • Country: tr
what is the real difference between PY32F002A and PY32F002B ?
 

Offline __george__

  • Contributor
  • Posts: 23
  • Country: no
what is the real difference between PY32F002A and PY32F002B ?

AFAIK the main difference is in the clocks, the PY32F002B has an LSE clock of 32.768 KHz and the PY32F002A has an HSE clock of 4-24 MHz. I read about this a while ago in another forum: https://www.stm32duino.com/viewtopic.php?t=1848&start=70

I am not sure if this is the reason, but the PY32F002B has less than double power consumption in the stop mode as well. PY32F002B has 1.5uA compared to the 4.5uA of PY32F002B.
 
The following users thanked this post: gerbay

Online Sacodepatatas

  • Regular Contributor
  • *
  • Posts: 128
  • Country: es
what is the real difference between PY32F002A and PY32F002B ?

AFAIK the main difference is in the clocks, the PY32F002B has an LSE clock of 32.768 KHz and the PY32F002A has an HSE clock of 4-24 MHz. I read about this a while ago in another forum: https://www.stm32duino.com/viewtopic.php?t=1848&start=70

I am not sure if this is the reason, but the PY32F002B has less than double power consumption in the stop mode as well. PY32F002B has 1.5uA compared to the 4.5uA of PY32F002B.

They have different silicons inside. Peripherals are similar but not exactly the same. The 002A officially has not DMA but because it has the same die as the 030, then the DMA exists and can be used. While the 002B has the same die as the 020 so it lacks of DMA completely.
 
The following users thanked this post: __george__, gerbay


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf