CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

How can external interrupt for pulse using pic 16F877

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
peter_pic



Joined: 18 Jul 2014
Posts: 5

View user's profile Send private message

How can external interrupt for pulse using pic 16F877
PostPosted: Fri Jul 18, 2014 8:28 am     Reply with quote

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: 9226
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jul 18, 2014 9:51 am     Reply with quote

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

View user's profile Send private message AIM Address

PostPosted: Sun Jul 20, 2014 11:12 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jul 29, 2014 9:16 am     Reply with quote

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: 9226
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Jul 29, 2014 10:33 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group