Please calm down.
The code examples I posted are just examples and of course I used higher speeds as well.
I did RTFM and tried different approaches including use of timer interrupts as I have stated in this thread.
Considering the long pipeline differing latency is a well known common problem with ARMs (check out various forums including official STM32).
Also, changing compiler optimizations in each case produce different latencies but they're always present.
Of course, if you're able to do it precise timings on STM32 output pins, feel free to do so and post scope screenshots.
I will be happy to be proven wrong but ATM I'm firmly standing behind my statement that less complex 8-bit and 16-bit MCUs (AVR, PIC, PIC24, dsPIC etc.) are more suitable for precise timings on output pins (reliably predictable number clock ticks).
1
on: November 04, 2024, 09:30:48 21:30
|
||
Started by LithiumOverdosE - Last post by LithiumOverdosE | ||
2
on: November 02, 2024, 07:32:17 19:32
|
||
Started by pickit2 - Last post by pickit2 | ||
This topic has been moved to Recycle Bin.
https://www.sonsivri.to/forum/index.php?topic=71371.0 I'm not removing this. leaving it here so other's can see it. I moved the post to waste bin and put the poster in Deep Sleep Mode. |
3
on: October 26, 2024, 02:13:57 14:13
|
||||||
Started by nullleiter - Last post by nullleiter | ||||||
|
4
on: October 24, 2024, 01:15:53 01:15
|
||
Started by LithiumOverdosE - Last post by wild | ||
your approach was MORE than messy: it was sloppy!
1) Why on earth did you set the timer/peripherials clock to 10/5 MHz? Set it to 80MHz and your jitter problems will almost disappear. 2) document yourself about TIM1 or TIM2: they are able to do in a perfect way what you need! RTFMs, RTFMs, RTFMs!!!!! Reference manual Programming manual Errata AMBA M4 Tech Ref ARM M4 Tech Ref BTW, as a compensation, you can use the documentation for the STM32L443RC instead of the STM32L431RC because all of the following chips mount the same die (YES, INSIDE they are the SAME): Code: DIE435 STM32L431C(B-C)Tx DIE435 STM32L431C(B-C)Ux DIE435 STM32L431C(B-C)Yx DIE435 STM32L431K(B-C)Ux DIE435 STM32L431R(B-C)Ix DIE435 STM32L431R(B-C)Tx DIE435 STM32L431R(B-C)Yx DIE435 STM32L431VCIx DIE435 STM32L431VCTx DIE435 STM32L432K(B-C)Ux DIE435 STM32L433C(B-C)Tx DIE435 STM32L433C(B-C)Ux DIE435 STM32L433C(B-C)Yx DIE435 STM32L433R(B-C)Ix DIE435 STM32L433R(B-C)Tx DIE435 STM32L433R(B-C)Yx DIE435 STM32L433RCTxP DIE435 STM32L433VCIx DIE435 STM32L433VCTx DIE435 STM32L442KCUx DIE435 STM32L443CCFx DIE435 STM32L443CCTx DIE435 STM32L443CCUx DIE435 STM32L443CCYx DIE435 STM32L443RCIx DIE435 STM32L443RCTx DIE435 STM32L443RCYx DIE435 STM32L443VCIx DIE435 STM32L443VCTx |
5
on: October 23, 2024, 09:02:38 09:02
|
||
Started by LithiumOverdosE - Last post by LithiumOverdosE | ||
Hi Your approach to writing software is wrong. for generating precise timing should involved using hardware timers - not general software loops or diving to assembly language. The STM32 timer are sophisticated hardware, some time hard to configure - but if you read the ST timer book you will be able to do it. if the timer resolution is not enough for you you can choose STM32 with high resolution timer like the STM32G4xx who can go down to nsec resolution. I have done a similar project using the hardware timers to produce a full bridge control - and it work very well using 2 timers only. in the G series you have 8 timers (more then enough.....) The DsPIC is far more degraded microcontroller in compare to STM32 where all high end software(timing , DSP ....) must be written in assembly language, language I abandoned long time ago when I switch from 8051 to MSP430. All the best Bobi I agree with you regarding my approach being messy. However, as I have stated earlier I'm stuck with this particular STM32 (not my choice) and there's nothing I can do to change it at this point when the darn thing is already integrated with rest of hardware. Considering time constraints for this project I found the approach with the loop to be working satisfactorily for my purposes because I simply don't have too much time to spend on debugging/troubleshooting (too) complex hardware. Of course I tried using timers/interrupts in several ways but there was always some problem regarding consistency of the timings. Judging from my searches on the net it seems that I'm not the only one who have encountered similar problems with timing precision/consistency with STM32. That said, I disagree with you regarding the dsPIC. While it is true that dsPIC is less sophisticated, for the same reason it has more predictable behaviour. Also, if extreme precision is not required I usually use pure C for work with timers/interrupts and I'm not quite sure why you would think that assembler is equired to do so. Too much sophistication inevitably leads to more complex debugging/troubleshooting process because any internal section in the chain can cause latency and unpredictability in behaviour. So, while ARMs in general provide more sophistication, in some cases (such as this one) they also add quite a bit to the development time and make debugging more complex. In this case, I simply don't need its sophistication so it leads to unnecessary addtional time spent on banal things such as timings on output pins. Personally I tend to use the simplest possible microcontrollers for particular projects exactly for such reasons and in this case with dsPIC/PIC24 I would already have it up and running properly with timers/interrupts. |
6
on: October 23, 2024, 07:28:05 07:28
|
||
Started by Signal - Last post by Catcatcat | ||
All schemes will work. A series resistor is needed only in certain specific cases. I recommend using ceramic resonators with built-in capacitors, they save space. In PIC, the generators are so reliable that they will run any resonator with any strapping. I almost never use resonators in my projects, the reliability and stability of the internal generator completely suits me.
|
7
on: October 23, 2024, 03:53:22 03:53
|
||||||
Started by HeRa - Last post by HeRa | ||||||
|
8
on: October 21, 2024, 09:04:11 21:04
|
||||||
Started by TIMA - Last post by pickit2 | ||||||
Английский язык является языком по умолчанию |
9
on: October 21, 2024, 09:02:20 21:02
|
||||||||
Started by sami - Last post by pickit2 | ||||||||
El inglés es el idioma predeterminado |
10
on: October 21, 2024, 04:56:01 16:56
|
||
Started by Signal - Last post by Signal | ||
Quartz oscillator is far more simple (1 decoupling cap is needed) no critical components placement, accurate trimming, low cost. I thought about it long time ago. Many doubts. Simplicity is questionable. You need additional power trace. In case device sleeps this line should be controlled too - so two uC pins anyway. Operational current is comparable with consumption of the whole device without oscillator. Sharp edges on several MHz - additional EMI considerations (maybe I am wrong). So my ancient conclusion - not for every project.<...>are available from the shelf for very low cost I should check if they are actually very low priced now. Thank you for pointing.The size is wrong. By the way, size reflects power, max power determines max Vp-p, that could be not enough for work or reliable work of given generator in uC, that usually depends on supply voltage. |