View previous topic :: View next topic |
Author |
Message |
mahdi70
Joined: 05 Jan 2016 Posts: 44
|
dspic33fj comparator |
Posted: Wed Jan 04, 2017 3:05 pm |
|
|
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
|
|
Posted: Wed Jan 04, 2017 6:30 pm |
|
|
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
|
|
Posted: Thu Jan 05, 2017 1:36 am |
|
|
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
|
|
Posted: Thu Jan 05, 2017 2:14 am |
|
|
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
|
|
Posted: Thu Jan 05, 2017 2:41 am |
|
|
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
|
|
Posted: Thu Jan 05, 2017 4:14 am |
|
|
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. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Thu Jan 05, 2017 6:33 am |
|
|
I'm kinda surprised that a 'powerhouse' PIC doesn't HAVE a comparator !
too many PICS, too little time..... |
|
|
|