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 / Timer operation on LPC1115 ARM7 controller

Timer operation on LPC1115 ARM7 controller

|

Projects › Projects › Timer operation on LPC1115 ARM7 controller

  • This topic has 0 replies, 1 voice, and was last updated 10 years, 5 months ago by venkatesh.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • May 25, 2015 at 9:13 am #3688
    venkatesh
    Participant

    Hi Friends,

     

    Presently I'm working on timer operation in LPC1115 ARM7  micro controller.

    I need to know how to set the timer registers and TCR and TC, PR etc.. 

    ex:if I set the minutes as 5 then after 60 secs it will rolls to 4 mins,3,…00.

    how to do it? I'm sending source file. please check it.

    and give me the solution.

    void timer16B0_Init(void) {
       LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 16);       //enables clock for 16-bit counter/timer 0
       //LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 16);  
       LPC_TMR16B0->TCR = 1;  //timer control reg.                            
    LPC_TMR16B0->MCR = 10;  //match control reg                            
    LPC_TMR16B0->PR =  10;  //prescale reg.                            
    LPC_TMR16B0->PC=1;       //prescale counter                            
     
       LPC_TMR16B0->MR0= 10;  //match controlreg for reg0                           
    NVIC_EnableIRQ(16);  //NVIC_EnableIRQ(TIMER0_IRQn);
     
                        }
     
    /void TIMER16_0_IRQHandler(void) {
    if((minutes_remaining == 0) && (hours_remaining == 0))
       {
    hours_remaining = 0;
    minutes_remaining = 0;
        }
    else
      {
    minutes_remaining–;
    if(minutes_remaining == 0)
     {
    minutes_remaining = 60;
    –hours_remaining;
     }
     
    //timer_flag=1;  //set the flag for timer operation
     
      }
     
         LPC_TMR16B0->TC=1;                                 
         LPC_TMR16B0->IR=1;       
     
     }
     
     
    Thanks in Advance 
    Venki

     

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

RSS Recent Posts

  • ESP32-S3 started outputting NMEA GPS location frames after EMC disturbance — what mode is this? November 15, 2025
  • TraxMaker Pro? I only have the non-Pro version. Looking for the Pro version that has the integrated pick and place coordinates export. November 15, 2025
  • Can a small solar panel safely trickle-charge old NiMH AA batteries? November 15, 2025
  • desoldering November 15, 2025
  • Need a fresh eye on my first PCB November 14, 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