DCO is a solution

granddad

Well-Known Member
Most Helpful Member
What a useful addition to the PIC18 , I was working out how i could provide a program controlled wide range clock signal , 10Mhz down to 8Hz on an output pin. PIC18F25K42 , Digitally Controlled Oscillator ,is just the ticket.
 
This series of parts out since early 2000's, 32 bit DDS, and WaveDACs, all on chip
as well as the others stuff depicted below. This DDS takes you down to 5 mili Hertz.

WaveDAC gives you AWG capability as well as typical sine, tri, saw, whatever.
Resources onchip good enough to do 4 channels. Lots of resources left for
other tasks, see right hand window.

You can do custom onchip resources via schematic capture and/or Verilog.




The following onchip, multiple copies in most cases :



PSOC 4, 5LP, 6.


Regards, Dana.
 
Dana , Seems your silicon has it all , I have an FPGA stick , it is still in its box. My programming skills are marginal even after 50 years of typing hex into a PC. I wondered if DCO would be of interest to PIC fans.
 
This part has a fabric like FPGA, but one does not get involved in in-depth
timing work. Simply drag and drop components (a component in
PSOC land is a onchip resource) onto design canvas. So chip has a large
number of fixed components, like cntrs, PWM, analog stuff, and some
components use the fabric.

All components have a rich set of API f() calls, to config and control the
component if real time changes needed, other wise initial config wizard
handles all this. So you generally dont write drivers for anything.

You basically drag and drop out of component library onto design canvas,
dbl click and configure, then use wire wizard to interconnect internally or
out to pins. There are many wizards, state machine wizards if you want to
use one, one for DMA, one for digital filter.....

So if you are programming a PIC your are equally competent to do PSOC.

Apart from the component std lib I show in prior post there are community
components, done by users, one can add to their catalog. I have done a couple
like 64 bit SIPO shift register, a 3 digit BCD to 7 seg decoder, 64 bit counter......

$ 20 gets you in the game, CY8CKIT-059, IDE and compiler free.

Several hundred example projects you can use/hack to do your own work.

An example I did to get a bursting sinewave generator :


This only took 4 lines of code because I did not write a user interface to it. Just
used the component configurator to set the burst parameters. It was just a
test bench jig. But would have been simple to add a LCD and interface using the
component API f() calls. I often use the digital filter project to process signals
on the bench, it runs in the background once configed. And does not use many chip
resources.






Regards, Dana.
 
Last edited:
What a useful addition to the PIC18 , I was working out how i could provide a program controlled wide range clock signal , 10Mhz down to 8Hz on an output pin. PIC18F25K42 , Digitally Controlled Oscillator ,is just the ticket.

Wow, that could be handy. For an instrument I created for airport control towers, I needed a volume controlled, variable pitch beeper. Controlling volume of piezo beeper is nearly impossible. The solution I came up with was a variable clock generator ( in an impossibly small package) and a digital pot driving a 1" speaker. It served the purpose well, but the clock chip was so small, I had to have the boards assembled.

This PIC would have let me do everything with one micro and a digital pot (of which there are many options).
 
For a couple (or more) of fixed frequencies the comparator could be used (thinking popcorn's application). A simple RC oscillator with different resistors (or capacitors) switched in by setting an appropriate pin to output. Not sure how to do volume.

Mike.
 
What a useful addition to the PIC18 , I was working out how i could provide a program controlled wide range clock signal , 10Mhz down to 8Hz on an output pin. PIC18F25K42 , Digitally Controlled Oscillator ,is just the ticket.
Modern PIC's have a crazy range of new peripherals and options, I use the 18F27K42 a lot - but you need to be careful which you choose, as there are slight differences with not all new peripherals available on all new devices.
 
I haves bunches of PIC18F2xK22s which are my goto parts. I'll have to get some of the newer parts where extra features may be handy.
 
Dana , The CY8CKIT-059 and IDE has a lot of things going for it, perhaps some future project, maybe a little costly at ~18GBP, for a clock generator,and UART (PIC18F25k42 is 28 dip 5v and cost ~ 2GBP ) and I had 4 in my stock ( Ah that's where I put them ).
 
@grandad, forgot to show the filter wizard, here is a requirement needed by
a poster to extract just power line frequency :




You can do FIR or IIR with it, and its dual channel, you can cascade the channels if needed.

Lastly the part is highly routable, you pick what pins you want (with few exceptions) for
digital and analog (the analog has a preferred but not mandatory port) and
internal interconnect trivial with wiring tool. If you decide to use the 20 bit DelSig (some
parts have 2 SARs for simul sampling and a 20 bit DelSig), there is even an ohmmeter tool
to evaluate routes where currents are flowing, like as in using onchip opamps and muxes
and DACs, to optimize errors.

There are several projects out there using it to create Oscope and Function Generator, MIT did one
for a class. Hackaday, did one if I recall. Its a breadboard in a chip basically.


Regards, Dana.
 
Last edited:
I would do this with a PSOC 4 low end part, devices < $1 depending on features. These are
subsets of the 5LP family. Board is more like $25, its a arduino type pinout, will take shields,
but in your case stay with PIC if you have parts and boards and design basically a one off.

Note on PSOC 5LP board, there are two 5LP parts on it, one on snap off programmer/debugger,
the other the target. Once you fin a project, and snap off programmer/debugger you can use that
to program parts or as a standalone, although its severely limited in I/O as you can see.



Regards, Dana.
 
Last edited:
If you're interested in the K42 you might want to check out the Q43. Very similar, but the 18F27Q43 has a little more... 3 NCO modules, 5 UARTs, 8 CLCs, 8K ram, and unlike the K42 the SFR's are back within reach of a MOVFF instruction.

Plus, being a little newer it's also a bit cheaper.
 
PSOC 5LP 64K RAM, 256K Flash, 2K EEPROM, 24 UDB (CLC like), 2 SAR, 20 bit DelSig,
4 OpAmps, 4 Comparators, S/H, Analog muxs, Mixer, 4 DACs, LUTs.....routable

PSOC 6, dual core ARM, targeted to bluetooth, cryptography.

Lots of choices.

Regards, Dana.
 
Last edited:
But doesn't come in DIP, or does it?
 
Looks like 27Q43 is 28pin dip.even 47Q43 as 40 pin dip. I have a couple of 57Q43 .. 48 pin TQFP 7x7mm 0.5m and a breakout board , have not plucked up courage to solder one yet..
.Edit Farnell have 40pin 47Q43 in stock . 2.34 GBP (PN 3052755)
 
Last edited:
Nice - just checked RS, they do the 27Q43 (and presumably others), I tend to like the 28 pin DIP versions

£1.78+vat (£2.14) from RS - silly money for such a packed device.

The 18F47J53 is an interesting device as well, and has USB.
 
Very similar, but the 18F27Q43 has a little more... 3 NCO modules, 5 UARTs, 8 CLCs, 8K ram, and unlike the K42 the SFR's are back within reach of a MOVFF instruction.

Wow, what a powerful set of features, especially for two bucks! It ties in nicely with an idea that's been rattling around in my head. I'm going to order some.
 
For the medical guys running dual CPUs for reliability/protection, and now crypto for security,
or dual RTOS's and protection, or BT server/gateways/audio, memory to 2 MByte, SRAM to 1 MByte,
high I/O pin counts, high PWM/Counter/Timer counts (32), M0+ & M4 core, here are SOC solutions for
those applications :



Not $2 parts by the way.....


Regards, Dana.
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…