Hi,
is it possible to show the interrupt frequency ?
regards
Jorg
PIC24FV32KA304 Interrupt frequency calculation
-
- Posts: 50
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 23, 2020 9:55 am
- Been thanked: 4 times
PIC24FV32KA304 Interrupt frequency calculation
- Attachments
-
- Interrupt frequency.jpg (32.97 KiB) Viewed 5329 times
-
- Matrix Staff
- Posts: 1465
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 204 times
- Been thanked: 347 times
Re: PIC24FV32KA304 Interrupt frequency calculation
You have specified an external source for the clock. So Flowcode does not know what the actual speed of the clock will be and so cannot calculate the interrupt frequency. The "Clock Speed" value near the bottom of the page is the speed of the internal clock.
-
- Posts: 50
- Joined: Wed Dec 23, 2020 9:55 am
- Been thanked: 4 times
Re: PIC24FV32KA304 Interrupt frequency calculation
Hi,
you know, that the clock is set to external by setup. The value which is normally used for internal calculation gets the quartz frequency. You always know too, if the "pll" is selected or not. All values for calculation are inside the program. Is it not possible?
Regards
Jorg
you know, that the clock is set to external by setup. The value which is normally used for internal calculation gets the quartz frequency. You always know too, if the "pll" is selected or not. All values for calculation are inside the program. Is it not possible?
Regards
Jorg
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 684 times
Re: PIC24FV32KA304 Interrupt frequency calculation
Hi Jorg,
Steve is correct with the timer set to External mode it is expecting pulses on the T1CK pin to be used to clock the timer. As Flowcode doen't know what's external to this pin it cannot work out the timings for you.
Setting the clock source to one of the internal clocks will allow Flowcode to then know and sync the timings up with the MCU clock source and do the calculation.
Steve is correct with the timer set to External mode it is expecting pulses on the T1CK pin to be used to clock the timer. As Flowcode doen't know what's external to this pin it cannot work out the timings for you.
Setting the clock source to one of the internal clocks will allow Flowcode to then know and sync the timings up with the MCU clock source and do the calculation.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Matrix Staff
- Posts: 1465
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 204 times
- Been thanked: 347 times
Re: PIC24FV32KA304 Interrupt frequency calculation
Looking at this in more detail, the datasheet says T1CON:TCS selects the source input and can be either "Internal (Fosc/2)" or "Timer1 clock source selected by T1ECS<1:0>". The latter has the following options:
When you dig into the SOSC clock source, things get complicated further.
As you can see, clocks and interrupt sources can be complex, and Flowcode does not always offer every solution in a neat way - especially when you consider the range of devices it supports. You can use your own C code to change the clock source in this register if you like. But then Flowcode cannot know the actual source of the clock.
As a convenience, the Interrupt Properties window calculates the actual interrupt frequency in the less complex cases. If you have clock settings that are more complex, then you will need to manually calculate the actual interrupt frequency and/or create some kind of "LED flasher" program that allows you to measure it for your settings.
- 11 = Reserved; do not use
- 10 = Timer1 uses LPRC as the clock source (fixed 31 kHz)
- 01 = Timer1 uses External Clock from T1CK (see Ben's post)
- 00 = Timer1 uses Secondary Oscillator (SOSC) as the clock source
When you dig into the SOSC clock source, things get complicated further.
As you can see, clocks and interrupt sources can be complex, and Flowcode does not always offer every solution in a neat way - especially when you consider the range of devices it supports. You can use your own C code to change the clock source in this register if you like. But then Flowcode cannot know the actual source of the clock.
As a convenience, the Interrupt Properties window calculates the actual interrupt frequency in the less complex cases. If you have clock settings that are more complex, then you will need to manually calculate the actual interrupt frequency and/or create some kind of "LED flasher" program that allows you to measure it for your settings.
-
- Posts: 50
- Joined: Wed Dec 23, 2020 9:55 am
- Been thanked: 4 times
Re: PIC24FV32KA304 Interrupt frequency calculation
Hi,
I know that you could do many setups. It was a discussion to find a way for a workaround not to use an oscilloscope.
A complete setup of the oscillator and timer section would be good, but this would take a lot of time.
Excuse me for posting this thread in the bug area.
Jorg
I know that you could do many setups. It was a discussion to find a way for a workaround not to use an oscilloscope.
A complete setup of the oscillator and timer section would be good, but this would take a lot of time.
Excuse me for posting this thread in the bug area.
Jorg