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

Is there a PIC with two NCO's

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



Joined: 03 Dec 2013
Posts: 215

View user's profile Send private message

Is there a PIC with two NCO's
PostPosted: Wed Oct 07, 2020 3:42 pm     Reply with quote

Is there a PIC with two NCO's ?

I need a second NCO and have considered a 6 pin PIC chip but do not like the idea of having to Program a second device...

Someone did suggest using the PWM but it's not that easy to set frequency to within 1 Hz.

Any suggestion are welcome.

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Oct 07, 2020 3:49 pm     Reply with quote

Go to this Microchip page:
https://www.microchip.com/maps/Microcontroller.aspx

Scroll down to this section: IC/OC/PWM

Then on the right, select NCO 3 and 3 (both boxes).

Then look at results at the top right.
temtronic



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

View user's profile Send private message

PostPosted: Wed Oct 07, 2020 4:17 pm     Reply with quote

Curious was I...
so...if I pressed the right buttons, there's only 28 pin devices that would work for you that are currently available....
Sounds like two 6 pin devices would be cheaper and easier to use as you have experience and code already for them?
A lot depends on project designs and near future requirements. while I'm a firm believer in 'more pins is better', cost may be more important for you ??

BTW the PIC18F25Q43 has a 900+ page 'datasheet'....so YOU will have to read it, not me, sorry !

Jay
soonc



Joined: 03 Dec 2013
Posts: 215

View user's profile Send private message

Thanks
PostPosted: Wed Oct 07, 2020 7:18 pm     Reply with quote

PCM programmer wrote:
Go to this Microchip page:
https://www.microchip.com/maps/Microcontroller.aspx

Scroll down to this section: IC/OC/PWM

Then on the right, select NCO 3 and 3 (both boxes).

Then look at results at the top right.


Thanks for the link.... Looks like a useful tool.

Another thought: How much code would it take to program the 6 pin PIC from a larger PIC ?

I just checked and the PIC10F322 can be programmed using Vdd only.

Anyone done this ?

Any examples ?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Oct 07, 2020 7:32 pm     Reply with quote

Library to program/verify a Microchip PIC12F629/675:
http://www.ccsinfo.com/forum/viewtopic.php?t=26816
temtronic



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

View user's profile Send private message

PostPosted: Thu Oct 08, 2020 4:41 am     Reply with quote

hmm. you mention you're using a 6 pin PIC now..adding a 2nd NCO means you only have 2 other 'free' pins to use for whatever else the program does.
You should explain in more detail the function or purpose of the project. We may be able to offer alternative PICs or peripherals to do what you need.
gaugeguy



Joined: 05 Apr 2011
Posts: 303

View user's profile Send private message

PostPosted: Thu Oct 08, 2020 6:22 am     Reply with quote

Why not use a PIC24 with a 32 bit timer (two 16 bit timers cascaded). This should give you the range and resolution you want. There are many that can be set up with two or more 32 bit timers.
temtronic



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

View user's profile Send private message

PostPosted: Thu Oct 08, 2020 11:58 am     Reply with quote

My 'gut feeling' is that the original poster wants a cheap (low cost) solution. That rules out PIC24 and PIC18 series PICs.
It sounds like he is using a 6pin PIC, so another identical PIC would be the most cost effective answer as he KNOWS the device, can program it and it works for him.
We'd have to have more information about the project to decide if there's a better solution.
Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19540

View user's profile Send private message

PostPosted: Thu Oct 08, 2020 12:31 pm     Reply with quote

You have to be careful, but a PIC like the 33EP32MC202 is only just over
a dollar!... Available in DIP28, and has five timers, with two 32bit 'pairs'.
It's quite amazing how cheap some of this family have become. I pay less
now for a chip running at 100MHz, with 512K of ROM, than I did originally
for the first little 18pin PIC's. Very Happy
soonc



Joined: 03 Dec 2013
Posts: 215

View user's profile Send private message

Thanks to everyone
PostPosted: Thu Oct 08, 2020 6:55 pm     Reply with quote

Thanks for the ideas.
The "mother chip" is pic18F47K42 which already has 1 NCO.
Reason for wanting to know of other PIC chip with more NCO's is the NCO is so easy to use.

I did Not consider using a timer simply because I do not want too many interrupts and running a timer to generate a square wave signal in range 50KHz to 150KHz would be too many interrupts. That said if there is a way to do that with timers and no or very few interrupts I'd appreciate to know how it's done.

In this example 50KHz to 150KHz 1 Hz resolution is Not required...

The only other requirement is reasonable 50:50 M/S for the square wave as it's a clock for switched cap filter.

So my solution is to use the LTC6904 which uses I2C and is easy to program but is sucking 1.5 to 2.5 mA where as another NCO in the PIC would not draw that much current. The current version of this hardware already has I2C so it made the choice of the LTC6094 much easier.

With regards to pins available... In this part of the design there are plenty of spare pains and the 6Pin Pic would have only needed 1 pin for line NCO out and 1 line to Rx Commands to change frequency.

The LTC6094 requires no programming other than initial setup through the I2C, and I have old code that I can reuse.

Price wise the LTC6904 is expensive but is easy to use. The 6pin PIC would have saved power and been cheaper but the thought of getting the programming to work from the mother chip is the main reason I'd sooner pay the cost of the LTC6904

Anyway Thanks for all the help...
Ttelmah



Joined: 11 Mar 2010
Posts: 19540

View user's profile Send private message

PostPosted: Fri Oct 09, 2020 1:16 am     Reply with quote

The timers in the PIC24/30/33, have the ability to automatically reset 'at' a
count. So can be set to count to 1000, 10000 etc., without needing
interrupts etc.. Might be worth investigating....
temtronic



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

View user's profile Send private message

PostPosted: Fri Oct 09, 2020 4:27 am     Reply with quote

quik comments...
Hmm, I did a search at Microchip and here are 5 PICs with one NCO having 6-8 pins. The PIC10F322 is about 50 cents US. The LTC8904, from Digikey US is $5 !! Since you already have the space for an 8 pin device, it might be worthwhile to use the 10f322 to replace the 6904. Along with saving money, you may save power as well. I haven't read the specs but I'd investigate it further. It would be a hardware option.
The software option, is to use one of the timers in your 'master' PIC. Again, you'll have to do some reading, but if you tell us the range/resolution of your signal output and PIC clock , someone here may be able to say 'yes or no' to if it's possible.

Jay
soonc



Joined: 03 Dec 2013
Posts: 215

View user's profile Send private message

PostPosted: Fri Oct 09, 2020 7:00 am     Reply with quote

Ttelmah wrote:
The timers in the PIC24/30/33, have the ability to automatically reset 'at' a
count. So can be set to count to 1000, 10000 etc., without needing
interrupts etc.. Might be worth investigating....


Yes but at some time it needs to toggel a pin to generate the square wave, the only way I know how to do that is in a very lean ISR... But that ISR would be pushing/poping the stack for every cycle at 150Khz !

I'll revisit the PIC10F322 and just accept the extra work of hardware programming.

Thanks for the help
newguy



Joined: 24 Jun 2004
Posts: 1909

View user's profile Send private message

PostPosted: Fri Oct 09, 2020 7:30 am     Reply with quote

No. Some timers can set and clear a pin. All you have to do is a quick skim of the data sheet. Modern PICs usually have 2 or 3 types of timer: timer 0 is usually unique, then there are even and odd timers. Just skim the data sheet regarding (I think) the even timers as they have the ability to set not only a period but also a duty cycle. Pretty sure they can be tied to a pin.
Ttelmah



Joined: 11 Mar 2010
Posts: 19540

View user's profile Send private message

PostPosted: Fri Oct 09, 2020 9:14 am     Reply with quote

It is slightly complex, but the timers on the PIC24/30/33, have an
'output compare' capability, which can set a pin high, set a pin low,
toggle a pin, do a delayed 'one shot' monostable output or send a pulse
at a specific count. This ability supports 32bit counters (has 32bit compare
registers). So these timers can generate quite complex operations based
on a particular 'count'.
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