Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Counter in a delay in PIC18 Microcontroller using C++

Status
Not open for further replies.

Darkbyte

Newbie level 3
Joined
Dec 13, 2010
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,314
Hi there , I am in a midst of a project and has some question to ask about
micro controller.

This is what one of the function that I would like to carry out in a micro controller and I would like to know whether it is workable and if it work , how do I go about doing it.

Lets make the delay as 2 second.
lets take the () bracket as the delay
, inside the () is the tasks required to do .

Start of delay -->( Pulses of signals are generated , a counter is set to determine how many rising/positive edge are there , tabulate the counts and use a nested loop to match the count & send a signal to display on the lcd after the delay has ended )-->end of delay


my application is like this : once i reach bus station 2 , the delay will be activate , 2 pulses will be generated and when the delay has end , i will program it such that it will display : station 2 on the lcd display.

Is this possible to program?
 

Hello,
Definitely;
Micro-Controller Timers are there to do that.

First you set the timer-trigger value for 2 seconds; then you can use an input signal to start the timer(= reach bus station 2). Then do what you need (inside the 2 seconds). Use an interrupt to get the signal when timer is overflowed.(ie end of 2 seconds).

Select the uC and it's clock that it's timer can go for 2 second. (eg 18F2550/4550 's Timer0 can do it )

Wish you success !
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top