Libraries for commonly used functions (like "delay", etc.)?

cancel
Showing results for 
Search instead for 
Did you mean: 

Libraries for commonly used functions (like "delay", etc.)?

1,736 Views
jverive
Contributor III

Are there any libraries available that contain a delay (or similar) function? I know I can use the hardware timer, and I'm working through the demo and associated header files and API calls, but there's a fair amount there to digest. A simple function call would certainly make things easier for getting code up and running while I dig through the murky details. Perhaps there is a public repository for such libraries?

 

Thanks,

 

Jeff Verive

Labels (1)
10 Replies

405 Views
jverive
Contributor III

Additional information: I am using KDS 1.1.1 and KSDK 1.0.0, with a FRDM-K22F board.

0 Kudos

405 Views
DavidS
NXP Employee
NXP Employee

Hi Jeff,

There are a couple of resources for getting generic PE components.

http://mcuoneclipse.com/

http://www.steinerberg.com/EmbeddedComponents/

Hopefully the Community people will add some too.

Regards,

David

0 Kudos

405 Views
jverive
Contributor III

Thanks, David. I'm going to check them out right now!

0 Kudos

405 Views
BlackNight
NXP Employee
NXP Employee

Hi Jeff,

the latest version is on GitHub, see Processor Expert Component *.PEupd Files on GitHub

You are probably mostly interested in the WAIT component:

pastedImage_0.png

or the Utility component which comes with many string manipulation utilities.

There is as well the Timout componet (timouts with timers).

If using the Kinetis SDK, do not forget to add the KinetisSDK component to your project, as it adds necessary glue layers to work with the SDK.

pastedImage_2.png

I hope this helps,

Erich

0 Kudos

405 Views
jverive
Contributor III

Erich,

These functions are certainly what I'm interested in. I have downloaded them from GitHub, and have even attempted to add the file (Wait_1.057_16.12.2012.PEupd) through ProcessorExpert>Import Components>Open(file name)>Open, and the operation seems to work fine, but nothing shows up in my project. The operation does display a dialog box informing me that the "Component(s) from package has been installed into C:\ProgramData\ProcessorExpert\PEXDRV_PE5_3 directory." The folder exists and contents appear, so that part of the process seemed to run fine. I can see what lloks like the right files in C:\ProgramData\Processor Expert\PEXDRV_PE5_3\Beans\Wait.

I have tried closing and re-opening the project that was to contain the installed component(s), but nothing shows up in the Components tab.

I have also tried right-clicking on the prooject name and importing the PE components that way, but still no luck? What am I doing wrong? Do I need to start a new project with Processor Expert enabled (maybe a stupid question, but I'm still new to the KDS IDE). I do have KSDK installed into the KDS environment through Help>Install new programs. I have also done Help>Check for updates and allowed updated components to install, and then closed and re-opened KDS.

Thanks,

Jeff Verive

Update: I have started a new project with PE enabled, and there are entries under the Components tab, but nothing that appears to be relevant to the Wait stuff). I tried installing the components again per each method, closing and re-opening the project, but still nothing shows up. I'm pretty sure I'm close to getting this right, but I need a pointer in the right direction. Is there something I need to know about working with "beans"? Also, when I am actually able to get the right components added to my project, do I need to do any special initialization(s) in my program before using the Waitms routine? I am using the K22F.

0 Kudos

405 Views
BlackNight
NXP Employee
NXP Employee

Hi Jeff,

There is a tutorial on KL25Z which shows the basic usage of Processor Expert: http://mcuoneclipse.com/2012/09/07/tutorial-enlighting-the-freedom-kl25z-board/

(this one was for CodeWarrior, but 95% applies to KDS).

That component you have loaded is from 2012: attached is the latest one, please use this one.

In short:

Yes, you need a Procesor Expert project, and you need to 'add' compnents to it in order to use them.

The component is shown in the Component Library view. Use the menu Processor Expert > Show Views to open them.

I is listed here:

You can double click on it to add it to your current project, or drag and drop it into the components view (onto the 'Components' folder):

pastedImage_3.png

Then Generate Code with this button:

pastedImage_4.png

You can drag&drop method names to your source:

pastedImage_5.png

And then use parameters as needed/specified:

  WAIT1_Waitms(500); /* wait 500 ms */

If you are using it in your own source file, do not forget to include the header file:

#include "WAIT1.h"

I hope that helps,

Erich

405 Views
jverive
Contributor III

Erich,

Thanks! I'm getting ready to go through the tutorial right now, so hopefully this old dog can learn some new tricks.  By the way, was there supposed to be an attachment  (for the Wait component?) in your reply? I can't seem to be able to find it.

Jeff

0 Kudos

405 Views
jverive
Contributor III

Son of a gun, it worked! I had to show the Component Library by doing the not so intuitive process of Window>Show View>Other...>Processor Expert>Components Library, and then click on the Alphabetical tab and drag and drop the Wait component into my Components folder, but it worked!  Thanks again! I'll replace the Wait component with the updated one once I get the link from you.

Jeff

0 Kudos

405 Views
BlackNight
NXP Employee
NXP Employee

attaching the file again, this time to this message.....

Erich

0 Kudos

405 Views
BlackNight
NXP Employee
NXP Employee

Hi Jeff,

yes, there is a zip file with the latest wait component attached.

Erich

0 Kudos