Not applicable
Jun 28, 2014
05:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 28, 2014
05:26 AM
Hi,
I wrote some line of code to drive a LED WS2812B.
I took inspiration from the approach of cpldcpu that has wrote something like this for another ARM microcontroller, but I have serious problems with timing of my board (XMC 2Go).
I evaluated the basic times for high and low datas, plus for NOP instruction; and I found this timing:
- High data about 2.7 - 3.47 us (with an error of 0.77 us)
- Low data about 1.93 - 5.47 us (with an error of 3.54 us, but you have to bear in mind the "while statement")
- NOP time about 11.8 - 11.2 us
- Max frequency generated with direct initialization (without NOP) port about 569 kHz
(all evaluated with a DSO Quad in "none mode"!)
Obviously with this times it's impossible to control a period of 1.25 us!
The basic code that I used for it was:
Obviously with and without "nop comments".
I think that the problem could be in this message:
"Warning: CPU is running at low speed (6238 kHz)."
That it has been discussed into a precedent post.
I'm new in Cortex M0, so I don't know if the DAVE compiler have some compiling problem :confused: or if it's a problem of initialization :confused:.
Could you help me?
I wrote some line of code to drive a LED WS2812B.
I took inspiration from the approach of cpldcpu that has wrote something like this for another ARM microcontroller, but I have serious problems with timing of my board (XMC 2Go).
I evaluated the basic times for high and low datas, plus for NOP instruction; and I found this timing:
- High data about 2.7 - 3.47 us (with an error of 0.77 us)
- Low data about 1.93 - 5.47 us (with an error of 3.54 us, but you have to bear in mind the "while statement")
- NOP time about 11.8 - 11.2 us
- Max frequency generated with direct initialization (without NOP) port about 569 kHz
(all evaluated with a DSO Quad in "none mode"!)
Obviously with this times it's impossible to control a period of 1.25 us!
The basic code that I used for it was:
int main(void)
{
// status_t status; // Declaration of return variable for DAVE3 APIs (toggle comment if required)
DAVE_Init(); // Initialization of DAVE Apps
while(1)
{
//__NOP();
PORT0->OMR = 0x00000001UL;
//__NOP();
PORT0->OMR = 0x00010000UL;
//__NOP();
PORT0->OMR = 0x00000001UL;
//__NOP();
PORT0->OMR = 0x00010000UL;
}
return 0;
}
Obviously with and without "nop comments".
I think that the problem could be in this message:
"Warning: CPU is running at low speed (6238 kHz)."
That it has been discussed into a precedent post.
I'm new in Cortex M0, so I don't know if the DAVE compiler have some compiling problem :confused: or if it's a problem of initialization :confused:.
Could you help me?
3 Replies
Not applicable
Jul 10, 2014
11:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 10, 2014
11:27 AM
Have someone an answer ?!
Not applicable
Jul 11, 2014
02:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 11, 2014
02:35 AM
Hi cosmok82,
I'm not familiar with WS2812B so I'm not really sure what you trying to do.
Perhaps you can give some details on what you try to achieve here?
And what is the MCLK you have set in your project?
As for the warning, is really has nothing to do with the CPU speed.
I'm not familiar with WS2812B so I'm not really sure what you trying to do.
Perhaps you can give some details on what you try to achieve here?
And what is the MCLK you have set in your project?
As for the warning, is really has nothing to do with the CPU speed.
Jan 15, 2016
05:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 15, 2016
05:32 AM
Do a release build by switching the active build configuration to "Release" and make sure the debug configuration is also using the binary you get from the release build and the operations will run at full speed.