Hi Everybody,
I am testing the kinestis clicker with MK22FN512VLH12 and the basic compiler for ARM V6.0.0
There are two problems:
1) The compiler itself it's becomed very slow to draw the screen and to react to the commands.
2) The compiler does not read correctly the programmed frequency in the "Edit project" menu
The point two it is limiting the use of almost all the internal librarys. As you know, most of the internal routines read the clock and mange the CLK cycles based on the programmed MCU frequency.
Right now, i have to find by my self and declare a frequency that match the real MCU frequency. Doing that i can see everything working fine.
Can you provide a solution for that ?
Thank you,
Alex
Wrong clk interpretation by compiler
- petar.suknjaja
- mikroElektronika team
- Posts: 683
- Joined: 05 Mar 2018 09:44
- Location: Belgrade
Re: Wrong clk interpretation by compiler
Hi Alex,
Could you tell me in more details if it is related to a particular project,or when it started to happen?
Have you tried to reinstall the mikroBasic compiler?
Kind regards,
Petar
Could you tell me in more details if it is related to a particular project,or when it started to happen?
Have you tried to reinstall the mikroBasic compiler?
Kind regards,
Petar
-
- Posts: 101
- Joined: 04 Nov 2016 13:09
Re: Wrong clk interpretation by compiler
Hi Petar,
1) As discussed with your collegue Filip, i have discovered the origin of the reduced redraw speed. It is something related to W10. If you select the voice "core isolation" in the device security panel you are disabling the hyper threding system of the x86 CPU. This seem to strongly affect the performances of some programs.
2) No. It is a long time that i did not install a clean version of uB.
I will keep you informed.
Thank you,
Alessandro
1) As discussed with your collegue Filip, i have discovered the origin of the reduced redraw speed. It is something related to W10. If you select the voice "core isolation" in the device security panel you are disabling the hyper threding system of the x86 CPU. This seem to strongly affect the performances of some programs.
2) No. It is a long time that i did not install a clean version of uB.
I will keep you informed.
Thank you,
Alessandro
-
- Posts: 101
- Joined: 04 Nov 2016 13:09
Re: Wrong clk interpretation by compiler
Hi Petar,
I did a new uB installation but it does not change anything.
Here, a brief descrption about what i am doing to test the MCU:
If you set the MCU frequency in the uB "Edit project" panel to 1Mhz you should see the led blinking with 1s period.
But if you run the small program that i have pasted, you will see that to get the correct blinking frequency you must put in the PIT_LDVAL1=31999999
So it seem that the real MCU frequency is 32Mhz.
The MCU is the Kinetis MK22FN512XXX12 (Kinetis clicker 2)
Thank you,
Alessandro
Test program:
sub procedure InitTimer0()
SIM_SCGC6.PIT = 1
PIT_MCR = 0x00
PIT_LDVAL0 = 999999
PIT_TCTRL0 = 3
end sub
sub procedure prova_timer() iv IVT_INT_PIT0 ics ICS_AUTO
PTA_PDOR.B12 = not PTA_PDOR.B12
PIT_TFLG0.TIF = 1
end sub
main:
GPIO_Digital_Output(@PTA_PDOR,_GPIO_PINMASK_12 or _GPIO_PINMASK_5)
PORTA_PCR13 = 0xA0000
PORTA_PCR4 = 0xA0000
GPIO_Digital_Input(@PTA_PDIR,_GPIO_PINMASK_13 or _GPIO_PINMASK_4)
InitTimer0()
PTA_PDOR.B12 = 0
PTA_PDOR.B5 = 0
NVIC_IntEnable(IVT_INT_PIT0)
while true
wend
end.
I did a new uB installation but it does not change anything.
Here, a brief descrption about what i am doing to test the MCU:
If you set the MCU frequency in the uB "Edit project" panel to 1Mhz you should see the led blinking with 1s period.
But if you run the small program that i have pasted, you will see that to get the correct blinking frequency you must put in the PIT_LDVAL1=31999999
So it seem that the real MCU frequency is 32Mhz.
The MCU is the Kinetis MK22FN512XXX12 (Kinetis clicker 2)
Thank you,
Alessandro
Test program:
sub procedure InitTimer0()
SIM_SCGC6.PIT = 1
PIT_MCR = 0x00
PIT_LDVAL0 = 999999
PIT_TCTRL0 = 3
end sub
sub procedure prova_timer() iv IVT_INT_PIT0 ics ICS_AUTO
PTA_PDOR.B12 = not PTA_PDOR.B12
PIT_TFLG0.TIF = 1
end sub
main:
GPIO_Digital_Output(@PTA_PDOR,_GPIO_PINMASK_12 or _GPIO_PINMASK_5)
PORTA_PCR13 = 0xA0000
PORTA_PCR4 = 0xA0000
GPIO_Digital_Input(@PTA_PDIR,_GPIO_PINMASK_13 or _GPIO_PINMASK_4)
InitTimer0()
PTA_PDOR.B12 = 0
PTA_PDOR.B5 = 0
NVIC_IntEnable(IVT_INT_PIT0)
while true
wend
end.
- petar.suknjaja
- mikroElektronika team
- Posts: 683
- Joined: 05 Mar 2018 09:44
- Location: Belgrade
Re: Wrong clk interpretation by compiler
Hi Alessandro,
I will try to reproduce the same behavior.
Could you send me in the meantime whole project zipped ?
Kind regards,
Petar
I will try to reproduce the same behavior.
Could you send me in the meantime whole project zipped ?
Kind regards,
Petar
- petar.suknjaja
- mikroElektronika team
- Posts: 683
- Joined: 05 Mar 2018 09:44
- Location: Belgrade
Re: Wrong clk interpretation by compiler
Can you tell me more about the clock scheme that you have been using in this example?
The clock scheme that is used in example must match the configuration oscillator bits
that are accessible in the Edit Project options in the mikroBasic compiler.
Kind regards,
Petar
The clock scheme that is used in example must match the configuration oscillator bits
that are accessible in the Edit Project options in the mikroBasic compiler.
Kind regards,
Petar
-
- Posts: 101
- Joined: 04 Nov 2016 13:09
Re: Wrong clk interpretation by compiler
Hi Petar,
First issue solved. It was a my fault. I totally forgot that i needed to match the programmed frequency with the MCU clk generator.
Sorry for that. I am working on several platform and several project...
Soon i will replay to you about the other stuff.
Thank you
Alessandro
First issue solved. It was a my fault. I totally forgot that i needed to match the programmed frequency with the MCU clk generator.
Sorry for that. I am working on several platform and several project...
Soon i will replay to you about the other stuff.
Thank you
Alessandro