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

Number of pwm on pic16F84

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



Joined: 26 Sep 2011
Posts: 6

View user's profile Send private message

Number of pwm on pic16F84
PostPosted: Mon Sep 26, 2011 5:47 pm     Reply with quote

Hi I am new to microcontrollers and i would like to know how many pwm channels does pic16F84 have and how can i verify please.

Thank you very much
asmboy



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

View user's profile Send private message AIM Address

PostPosted: Mon Sep 26, 2011 5:55 pm     Reply with quote

1-
16f84 - has less than 1 hardware pwm channel
but could have a software based PWM if a very low frequency for PWM will
cut it in software.

2-
normally you check the DATASHEET for the pic to see its hardware functions
jhonny13deep



Joined: 26 Sep 2011
Posts: 6

View user's profile Send private message

PostPosted: Mon Sep 26, 2011 6:07 pm     Reply with quote

Can i make a small robot with many sensors using that pic? Like the one on this link http://www.societyofrobots.com/robot_tutorial.shtml I found the datasheet http://pdf1.alldatasheet.com/datasheet-pdf/view/74975/MICROCHIP/PIC16F84.html but i can't identify the number of pwm here.

asmboy wrote:
1-
16f84 - has less than 1 hardware pwm channel
but could have a software based PWM if a very low frequency for PWM will
cut it in software.

2-
normally you check the DATASHEET for the pic to see its hardware functions


Last edited by jhonny13deep on Mon Sep 26, 2011 6:14 pm; edited 2 times in total
asmboy



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

View user's profile Send private message AIM Address

PostPosted: Mon Sep 26, 2011 6:13 pm     Reply with quote

You certainly MAY - as there is no law against it
but only YOU will know if you CAN.

If it were me - I'd look further up the product tree for PICS with ADC and PWM capability as well as more timers.

Could make the task simpler and give you a more flexible baseline to grow on too. The 16f886 comes to mind as pretty feature rich in that way.

BTW there are many datasheets at microchip.com
jhonny13deep



Joined: 26 Sep 2011
Posts: 6

View user's profile Send private message

PostPosted: Tue Sep 27, 2011 9:01 pm     Reply with quote

How can I know and be sure before buying how many pwm, adc and pins I will need when choosing my microcontroller please?
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue Sep 27, 2011 11:11 pm     Reply with quote

Refer to the datasheet. PIC16F84 has 0 PWM outputs.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Sep 27, 2011 11:44 pm     Reply with quote

Since you don't know what your final project specifications will be,
it's best if you use a PIC with a medium or large number of pins
and features. Depending on how much physical space is available,
I would suggest a 16F886 (28 pin DIP) or 16F887 (40 pin DIP).

Read the data sheet for these PICs:
http://ww1.microchip.com/downloads/en/DeviceDoc/41291F.pdf
temtronic



Joined: 01 Jul 2010
Posts: 9246
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Sep 28, 2011 4:53 am     Reply with quote

Bigger is better ! Right now I can buy 18F4550 cheaper than the 16F877 that I've used for 2 decades.
If you use a 40pin DIP package, you'll have lots of 'extra' pins, peripherals, memory, speed, etc. for future projects.

BTW you can easily get 8 PWM from a 16F84. There are serial servo controllers available that used that PIC. I did build a 12 channel unit with a 16C84 once. Yes, done under software NOT hardware but to me 'PWM' doesn't mean dedicated hardware.

You have to know the design criteria before you choose the PIC but consider the 4550 tons of power 'under the hood'.
jhonny13deep



Joined: 26 Sep 2011
Posts: 6

View user's profile Send private message

PostPosted: Thu Sep 29, 2011 5:58 pm     Reply with quote

Ok thanks for the info, this question is really important for me to understand
how many sensors can i use with a 40 pin pic? For example, how do i find out how many pins will i need for this sensor(http://www.robotshop.com/ca/sharp-gp...-sensor-2.html)?
Thank you very much


Last edited by jhonny13deep on Thu Sep 29, 2011 6:13 pm; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Sep 29, 2011 6:12 pm     Reply with quote

If you want help on using a sensor with CCS, you need to post the
complete link (not "gp...-sensor") or post the manufacturer and part number.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Sep 29, 2011 6:23 pm     Reply with quote

It has an analog output. It can be measured with A/D converter on
the 16F886 or 16F887. Those chips have at least 11 A/D channels per
chip, and you only need one channel for this sensor.
jhonny13deep



Joined: 26 Sep 2011
Posts: 6

View user's profile Send private message

PostPosted: Thu Sep 29, 2011 6:27 pm     Reply with quote

Sorry,
Here's the link
http://www.robotshop.com/sfe-acs712-low-current-sensor-breakout.html

PCM programmer wrote:
If you want help on using a sensor with CCS, you need to post the
complete link (not "gp...-sensor") or post the manufacturer and part number.
jhonny13deep



Joined: 26 Sep 2011
Posts: 6

View user's profile Send private message

PostPosted: Thu Sep 29, 2011 6:32 pm     Reply with quote

So you don't look at the pins you look at the number of A/D channels it takes to install the maximum number of sensors on a pic?

PCM programmer wrote:
It has an analog output. It can be measured with A/D converter on
the 16F886 or 16F887. Those chips have at least 11 A/D channels per
chip, and you only need one channel for this sensor.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Sep 30, 2011 12:22 pm     Reply with quote

Download the PIC data sheet. To get the data sheet, type this into
http://www.google.com
Quote:

PIC16F887

The first hit will take you to the Microchip page for the 16F887, and you
can download the data sheet there. Near the front of the data sheet,
there is a table that lists the main features of the PICs in the 16F887
series. You can see the number of i/o pins on each PIC, and the number
of A/D channels, and the number of hardware PWM channels (1 for CCP
and 1 for ECCP = 2 PWM channels). Of course, normal i/o pins can be
used for software PWM.

Basically, you need to read the data sheet. We don't want to read it for
you. You need to find the number of A/D channels on the PIC that you
are considering to buy, and decide if it's enough. You need to start
thinking about the project instead of asking us what to do for every little
detail.
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