View previous topic :: View next topic |
Author |
Message |
peter_pic
Joined: 18 Jul 2014 Posts: 5
|
How can external interrupt for pulse using pic 16F877 |
Posted: Fri Jul 18, 2014 8:28 am |
|
|
Hello everybody,
I have own project for using pic 16F877 for modify pulse (pwm) for injection nozzle and sequence is 1-3-4-2. I have the question as below.
-How can interrupt both channel 1-2.
-When have the interrupt need to on such as 1-3 or 4-2, and then on timer together and read value (%) and wait falling edge then on to next nozzle by compare base on timer.
As above is my idea, but I cannot create code for this project. Then please help me like a guideline for do it.
Thanks,
Peter, _________________ The microcontroller can change everything. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Fri Jul 18, 2014 9:51 am |
|
|
first step. Choose a different PIC as the '877 is almost obsolete! There are several newer versions, pin compatible like the '887. It's also cheaper.
2nd step. Use a breadboard or 'prototyping' board and program the PIC for the '1Hz flashing LED' test. This will confirm your hardware and software are correct
3rd step.Read the datasheet sections on timers and PWM. Decide on the appropriate rates and setups.We can't do that as we don't have your injectors.
4th. Create an overview or flowchart of your project.Sounds like you have 4 injectors but why only 2 interrupts?
5th. Post your efforts here.we can't guess what you're trying to do.
hth
jay |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Sun Jul 20, 2014 11:12 am |
|
|
1-post a schematic for your design
2-post the injector datasheet
3-post any code you have written already
then help may be possible .
if you do some meaningful code and schematic work,
and show it, then others may be inclined to help.
nobody with any skill will bother when you have not shown
any initiative at the start yourself.
whose project is this ? Your class in school ? |
|
|
peter_pic
Joined: 18 Jul 2014 Posts: 5
|
|
Posted: Tue Jul 29, 2014 9:16 am |
|
|
My idea is to modify (increase or decrease) the PWM signal for four injectors between 0.5 and 10 percentage by potentiometer.
Frankly, I know a little of CCS for PIC, so could you suggest me for start.
Thanks, Peter_pic.
[img]http://upload.siamza.com/1386996[/img] _________________ The microcontroller can change everything. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Tue Jul 29, 2014 10:33 am |
|
|
first step is to get the PIC up and running with a 1Hz LED test program...this will confirm your PICboard is operational.
next look the the examples folder that CCS supplies, there will be a PWM program in there as well as several ADC programs
Also search the 'code library' as well as this forum for PWM programs. Probably 20-30 of them.
You have to break down your project into small 'sub programs' then merge into what you need.
I don't have time to do it and without the real hardware can't properly test any of my code, you have to do that !
hth
jay |
|
|
|