element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Freedom development platform
  • Products
  • Dev Tools
  • Freedom development platform
  • More
  • Cancel
Freedom development platform
Forum Freescale Freedom Development Platform (Questions and Answers)
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Freedom development platform to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 42 replies
  • Subscribers 9 subscribers
  • Views 4219 views
  • Users 0 members are here
  • 32bit
  • low_power
  • cortex-m0+
  • freescale
  • freedom_board
  • Cortex-M
  • microcontrollers
  • kinetis
  • arm_cortex_m
  • cortex
  • arm_cortex
  • kinetis-l
  • microcontroller
  • mcu
  • cortex-m0
  • arm
  • arduino
  • freedom
Related

Freescale Freedom Development Platform (Questions and Answers)

FreescaleTools_and_Software
FreescaleTools_and_Software over 12 years ago

Hello FRDM-KL25Z buyer

 

You are already thousands of customers who ordered this board.

In order to make your life easier, with a single place where to find relevant informations concerning this tool, I will try to collect in this post the answered questions concerning FRDM-KL25Z, found in different places like Freescale community, groups from Element14 Community or anywhere on the web ...

 

I will publish regularly (in the document section from this group) some very instructive tutorials produced by my colleague Erich Styger, which should help you to take in hand FRDM-KL25Z and its software tools (Codewarrior 10.3beta, Processor Expert ...).

 

Don't hesitate to post here your new questions that we can answer it and share it with the community.


  • Sign in to reply
  • Cancel
Parents
  • FreescaleTools_and_Software
    FreescaleTools_and_Software over 12 years ago

    QUESTION

    You are looking for a simple Processor Expert example to make a single channel conversion with the ADC ?

     

    ANSWER

    You can use the typical example code below or download the FRDM-KL25Z Sample Code Package available on Freescale website : www.freescale.com/FRDM-KL25Z

    There is a driver example for adc16 in the folder : kl25_sc \ klxx-sc-baremetal \ src \ drivers \

     

    AD1_TResultData MeasuredValue[SAMPLE_GROUP_SIZE];

    LDD_TDeviceData *MyADCPtr;

    LDD_TError Error;

     

    MyADCPtr = AD1_Init((LDD_TUserData *)NULL); /* Initialize the device */

     

    Error = AD1_SelectSampleGroup(MyADCPtr, 1U);

    Error = AD1_StartSingleMeasurement(MyADCPtr); // Start continuous measurement

    while (!AD1_GetMeasurementCompleteStatus(MyADCPtr)) {}; // Wait for conversion completeness

    Error = AD1_GetMeasuredValues(MyADCPtr, (LDD_TData *)MeasuredValue);  // Read measured values

    FsrReadings[1] = MeasuredValue[0];


    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to FreescaleTools_and_Software

    I tried creating a PE ADC example, but the AD1_Init generated in AD1.c reads: void AD1_Init(void)

    so your example code MyADCPtr = AD1_Init((LDD_TUserData *)NULL); /* Initialize the device */

    incurs both an argument error and a result void can't be used error.

     

    I looked around a bit, and AD1_Init is actually called by PE initialization. So where do I get MyADCPtr from?

     

    Can you redo the example?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Former Member
    Former Member over 12 years ago in reply to FreescaleTools_and_Software

    I tried creating a PE ADC example, but the AD1_Init generated in AD1.c reads: void AD1_Init(void)

    so your example code MyADCPtr = AD1_Init((LDD_TUserData *)NULL); /* Initialize the device */

    incurs both an argument error and a result void can't be used error.

     

    I looked around a bit, and AD1_Init is actually called by PE initialization. So where do I get MyADCPtr from?

     

    Can you redo the example?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • FreescaleTools_and_Software
    FreescaleTools_and_Software over 12 years ago in reply to Former Member

    Hello Gerrit

     

    If you want to produce a simple project using the ADC with Processor Expert,

    I would recommend to download the KL25 SampleCode V4 on Freescale website HERE (direct download link),

    as new release now include a project example, called TPM Demo, featuring the ADC peripheral.

     

    - Extract the package

    - Launch CodeWarrior 10.3

    - Right-clik in the Codewarrior Project Explorer Panel

    - Choose Import, General, Existing Projects into Workspace, Browse directory ... Kinetis-L Sample Code

    - Select TPM Demo PE then Finish

     

    If you want to access the ADC parameters, used for this project, double-clik on ProcessorExpert.Pe and Select ADC0 in the component panel.

     

    Tricks : In Codewarrior, if you have lost some windows or if you simply want to reorganize your views, simply select "Windows", "Reset Perspective ..."

     

    PS: don't hesitate to share with the community if this answer was helpfull to solve your issue

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to FreescaleTools_and_Software

    Thanks, I'll review the TPM Demo. I was experimenting last weekend, and used Processor Expert to set up sampling on two pins. Looked at the code it generated and was able to invoke it and achieve correct 12b sampling at 33 kHz both inputs, purely in a software loop on the FRDM-KL25Z. Pretty impressive.

     

    I'm now going to switch from FRDM-KL25Z to KL05Z to be closer to final production part, so if you happen to be creating another example, would be nice to have it for the KL05Z as well.

     

      regards, Gerrit

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube