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

dspic33fj comparator

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



Joined: 05 Jan 2016
Posts: 44

View user's profile Send private message

dspic33fj comparator
PostPosted: Wed Jan 04, 2017 3:05 pm     Reply with quote

hi buddies.....i want to use dspic33fj256gp506 comparator with external refrence voltage..how to do it..anybody can help me? example source?

tnx alot
temtronic



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

View user's profile Send private message

PostPosted: Wed Jan 04, 2017 6:30 pm     Reply with quote

While I don't use that PIC, obvious place I'd start is the datasheet, chapter on comparator section then look at the CCS device header then the examples CCS supplies
Assuming you've got your PIC 'up and running', it should only take an evening to cut code/compile and test.
Most PICs share a LOT of peripheral sections,though newer ones may have more 'under the hood', basic operation is generally the same. You'll have to 'tweak' this or that, especially with 'pin selectable' PICs.

Jay
Mahdi



Joined: 21 Aug 2012
Posts: 47

View user's profile Send private message

PostPosted: Thu Jan 05, 2017 1:36 am     Reply with quote

i can run comparator on pic16 or pic18 but iam confused about dspic comparator...i read datasheet but Did not understand anything about Which 2 pin use for compare...when i read datasheet I saw "OCFA" or " Compare Fault A input (for Compare Channels 1, 2, 3 and 4). ".what is this??
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Thu Jan 05, 2017 2:14 am     Reply with quote

Your chip does not have a comparator.
Probably explains why you are having trouble!.....

If you look, there is no section in the data sheet actually entitled 'comparator'. Unfortunately the word 'comparator' is used inside the data sheet for the section handling timer comparisons. This 'compares' timer values with fixed values, to trigger certain events (output compare for example, or ADC sampling).

If you go into the Microchip product selector for the DsPIC's. Select the option for 'all parameters', select the column for comparators (about ten from the left), and select '0', you will find your chip is one of the ones listed.....
mahdi70



Joined: 05 Jan 2016
Posts: 44

View user's profile Send private message

PostPosted: Thu Jan 05, 2017 2:41 am     Reply with quote

Ttelmah wrote:
Your chip does not have a comparator.
Probably explains why you are having trouble!.....

If you look, there is no section in the data sheet actually entitled 'comparator'. Unfortunately the word 'comparator' is used inside the data sheet for the section handling timer comparisons. This 'compares' timer values with fixed values, to trigger certain events (output compare for example, or ADC sampling).

If you go into the Microchip product selector for the DsPIC's. Select the option for 'all parameters', select the column for comparators (about ten from the left), and select '0', you will find your chip is one of the ones listed.....


You are right..i am sorry...i saw the comparator option in ccs wizard and I thought that this chip supports internal comparator...tnx alot
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Thu Jan 05, 2017 4:14 am     Reply with quote

If you've followed the posts here at all, you will know my opinion of the Wizard!....
Exactly the sort of problem it so easily causes. Crying or Very sad
temtronic



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

View user's profile Send private message

PostPosted: Thu Jan 05, 2017 6:33 am     Reply with quote

I'm kinda surprised that a 'powerhouse' PIC doesn't HAVE a comparator !

too many PICS, too little time.....
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