Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 19:35 29 Mar 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2 1 second tick question

Author Message
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3422
Posted: 12:47pm 17 Nov 2021
Copy link to clipboard 
Print this post


PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3422
Posted: 12:55pm 17 Nov 2021
Copy link to clipboard 
Print this post

Dear forum members.

For research on a real time clock accuracy, I would need a 1Hz adjustable frequency.
Easy to do with a "settick" command... But then my adjustment range for the timing is quite coarse. 999ms, 1000ms, 1001ms

Is there any way (on the CMM2, because I have a lot of data to process) to create a 1Hz square wave that can be adjusted finer (i.e. in 10us or even 1us steps).
In essence I want to create a PLL that locks to an external 1Hz signal, and the PLL is controlled from ASCII (numerical) output of the system I want to inspect.

Any help is welcome,

Volhout

P.S. if you want the details: the system to inspect makes an error during the wrap around of a 32.768kHz (HW counter) and the increment of the second counter (software) when an interrupt comes in between. In my current test setup once per 8 hours this happens. I am trying to force the external interrupts to exactly happen at the wrap around, in stead of wait until it occurs.
PicomiteVGA PETSCII ROBOTS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5648
Posted: 02:58pm 17 Nov 2021
Copy link to clipboard 
Print this post

10kHz PWM fed back into a counter then set a flag every time it reaches 10,000?

Normally you'd be aiming for an accurate 1Hz to measure something against. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3422
Posted: 10:14pm 17 Nov 2021
Copy link to clipboard 
Print this post

I was hoping to use one of the 2 32 timers to create a high resolution pwm, that would be fixed at 50%, but the frequency could be set to 1Hz. With high resolution.
Since i am debugging a sw timer, this one must be full HW, hence the stm32 32 bit timer.
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8517
Posted: 10:38pm 17 Nov 2021
Copy link to clipboard 
Print this post

  Quote  I was hoping to use one of the 2 32 timers to create a high resolution pwm


You could do it with timer2, the output would be on PA15 (pin 18 on the connector). To set it up you are going to need to read the relevant sections of the reference manual and poke some registers accordingly (all do-able from basic). Doing this would break the fast count function but nothing else.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3422
Posted: 08:12am 18 Nov 2021
Copy link to clipboard 
Print this post

Thanks... that was what I was looking for.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024