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

16F88 PWM output not working

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



Joined: 22 Aug 2010
Posts: 43

View user's profile Send private message

16F88 PWM output not working
PostPosted: Sat Mar 22, 2014 12:20 pm     Reply with quote

Hello,

I am trying to use the PWM in the CCP module of pic16F88 microcontroller.

I read a lot of threads here about how to configure CCP module for PWM, & i did the program according to this, then i tried to simulate the program using proteus but it didn't work.

The program is shown below, Please advise what is the problem

Code:

#include <16F88.h>
#device ADC=10
#fuses HS,NOWDT, NOPROTECT //defining oscillator, no watch dog timer, no code protection
#use delay(clock = 8000000) //Oscillator 8MHZ


void main() {

int timer2_value = 0;
 
/*
Setup PWM in CCP1 module
1- Setup Timer 2
2- Setup CCP1 module in PWM mode
3- Select PWM output
4- Setup the duty cycle
*/


setup_timer_2(T2_DIV_BY_16,248,1);
setup_ccp1(CCP_PWM);
set_pwm1_duty(50);

//set_tris_b(0b11110111);

while(1) {



}
}


Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Mar 22, 2014 1:06 pm     Reply with quote

But if you search the net with Google, you find that certain versions of
Proteus ISIS don't work with PWM. Some people say Proteus 7.5 SP3
has PWM bugs.

Read this thread and the links in it, which explains that Proteus is buggy
and we don't want Proteus problems on this forum, and links explain why:
http://www.ccsinfo.com/forum/viewtopic.php?t=47549
hisham.i



Joined: 22 Aug 2010
Posts: 43

View user's profile Send private message

PostPosted: Sat Mar 22, 2014 1:23 pm     Reply with quote

PCM programmer, i thought the problem may be from my software! This is why i posted this here.
If i knew that the bug could be from Proteus i didn't post this thread here from the beginning!

Can you suggest a development board that is suitable for wide variety of microcontrollers, so that i will try my software on these development boards?

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Mar 22, 2014 1:41 pm     Reply with quote

I use the older PicDem2-Plus, which is not available anymore. I can't
really recommend the new PicDem2-Plus because it has too many
changes from the original board that are not good.

You can do a Google search for this and find many boards.
Quote:
PIC development board


Probably the best thing to do is to open this thread up and ask others
what their favorite PIC developement board is. It must be one that
can be bought on the open market. Not a home-built board.

You will also need a programmer. Probably a low-cost one, such as
the Pickit 3, or something else.
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

development boards i have used.
PostPosted: Sat Mar 22, 2014 2:18 pm     Reply with quote

http://www.pcboard.ca/

these folks have low cost PROTO PCBS in 28 and 40 pin dips - low cost - needs your assembly - useful for adding custom circuitry - has rs-232 support and room to poplate the pic area with a ZIF socket.

-----
http://www.ebay.com/itm/Powerful-PIC-development-board-PIC-EK-PIC-KIT-TOOL-PIC18F452-Microcontroller-/140954268258?pt=LH_DefaultDomain_0&hash=item20d1877262

and all purpose dev sys that accepts 8 thru 40 pin pics with ports on sockets wired in common. useful for very preliminary stuff IMB

-------
http://www.ebay.com/itm/QL200-PIC-Microchip-LCD-USB-MCU-ICD-Development-Board-/250873650112?pt=LH_DefaultDomain_0&hash=item3a693c1bc0

similar but with much more functionality and peripheral parts
-------
http://www.ebay.com/itm/PIC-Development-Learning-Board-Kit-16-2-LCD-16F877A-/290307572232?pt=LH_DefaultDomain_0&hash=item4397ae0208

a cheaper unit but nice for basic PIC work and less costly than the above

i have several other flavors of dev boards but these are my faves --

FYI above is not a plug for ebay - but i have found a lot of china import dev boards that i like and are affordable there - doc is quite complete and generally supplied by dropbox link or similar

and BTW:
my fave programmer for both sockets and ICSD is
the U2
from
http://store.melabs.com/cat/programmers.html
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Sat Mar 22, 2014 2:23 pm     Reply with quote

I use the easyPIC7 with the ICDU64 for PIC12/16/18 development.
There are cheaper ones out there but I don't think there are any better.

You can find a used easyPIC6 a lot cheaper...
_________________
Google and Forum Search are some of your best tools!!!!
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