![]() |
![]() |
![]() |
|
|
|||||||
| Robotics Chat Specific to discussions about robots and the making of. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
I am a Noob but I am trying to learn from the datasheet and strugling.
I want to read in 5 pulses and then output one pulse for 1.5 seconds. I can do both myself but I can not do them simultaneous. My program is a right mess now so I am going to start again. I have not used tmr0 yet but I am wondering if that is how I do it. Currently I have F84 and F628 to choose from. 1....Count in five pulses 2....Now output a 1.5 sec high 3....Go back and read in five pulses but carry on output until 1.5 secs ends. 4....If five pulses are in before 1.5secs are over then refresh output back to 1.5secs and start output again. My main problem is that I do not know how to carry on running my program whilst outputting and checking output to see if the 1.5secs are over. Thank you |
|
|
|
|
|
|
(permalink) | |
|
Quote:
In your interrupt routine you'd decrement COUNTER if it is not zero and also output a "high" for the pulse. If COUNTER is zero, you'd just output a "low" for the end of the pulse (no decrementing COUNTER) and exit.
__________________
--- The days of the digital watch are numbered. --- |
||
|
|
|
|
|
(permalink) |
|
Thank you for your guidance.
Is an interrupt routine something you code yourself or is it something you call that is already resident in the chip. Going to work now so hope to read this later. |
|
|
|
|
|
|
(permalink) |
|
You code it yourself. You also have to set the PIC to generate interrupts when the timer overflows etc so your routine will run at a set interval. Look at the PIC docs for the INTCON, PIR1 and PIE1 registers for more info. Section 8 of the Mid-Range MCU Family manual has more details:
http://ww1.microchip.com/downloads/e...Doc/33023a.pdf
__________________
--- The days of the digital watch are numbered. --- |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| Need help badly on Inchworm and MPLAB | thushy | Micro Controllers | 14 | 11th March 2007 06:05 PM |
| Effects | stephenpic | Micro Controllers | 6 | 19th January 2004 11:57 AM |
| VERY low voltage on output pins, please help! | New2PIC | Micro Controllers | 1 | 18th January 2004 03:21 AM |
| Question about reading bits from ports. | Blueteeth | Micro Controllers | 5 | 5th January 2004 01:08 PM |
| Parallel Port output device to control low Voltage equipment | Gabrielle | Electronic Projects Design/Ideas/Reviews | 8 | 7th August 2003 02:18 AM |