EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / Required information regarding frequency generation in LPC11xx

Required information regarding frequency generation in LPC11xx

|

Projects › Projects › Required information regarding frequency generation in LPC11xx

  • This topic has 0 replies, 1 voice, and was last updated 9 years, 8 months ago by Skylite.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • September 12, 2015 at 7:11 am #3980
    Skylite
    Participant
    Hi All!!
     
    As i'm very new to embedded domain of ARM lpc11xx, i'm going through
    all the basics and the examples of the controller.
     
    I need to generate 9hz for particular time duration[say for 20 secs/min],
    and another freq of 12hz for 25secs/min.
     
    Below is the part of the code where i'm getting the variable frequency of
    9.4hz,7.6hz,12hz, whereas I have only assigned [1/1000us = 1khz],
    void timer16_0_init(uint32_t delayInMs) //for frequency part
    {
    volatile unsigned int i;                 
     LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 7);        //enables clock for 16-bit counter/timer 0
     LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 8);        //enables clock for 16-bit counter/timer 1
    //PIO0_8
     LPC_IOCON->PIO0_8 &= ~((1<<10)|(1<<5)|(3<<3)|(7<<0));
     LPC_IOCON->PIO0_8 |=  ((2<<3)|(2<<0));               

     LPC_TMR32B0->MR0 = 50 * ((SystemCoreClock/(LPC_TMR32B0->PR+1))/100);
      LPC_TMR16B0->PR  = 00;               
      LPC_TMR16B0->MR3 = 1000;//freq is generated at this point of match register          
      LPC_TMR16B0->MR0 = LPC_TMR16B0->MR3/4;    //MAT0 1/4 low, 3/4 high
      LPC_TMR16B0->PWMC = ((1<<0)|(1<<1)); 
      LPC_TMR16B0->TCR = 1;                    //start timer 0//clock runs & tim dec
      
    }
     

    Kindly give me some hint on how to set the time duration for particular frequencies.

    Thank you.

  • Author
    Posts
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • stud mount Schottky diodes May 14, 2025
  • LED circuit for 1/6 scale diorama May 14, 2025
  • Can I use this charger in every country? May 14, 2025
  • Electronic board faulty?!? May 13, 2025
  • using a RTC in SF basic May 13, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise