Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 00:42 29 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : DDS frequency generator using PicoMite

     Page 3 of 3    
Author Message
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 10:46am 04 May 2023
Copy link to clipboard 
Print this post

Well Righty then

All working!  I need to trim here and there

Tested to 100Khz  for Sine, triangle and square



Sine..



Triangle..



Square..

The square wave starts to distort around 500Khz.
The onboard amp distorts the triangle and sine around 3V3 so the level maxes out at 56.
I just need to set max level (100%) to that figure..

Apart from that, I'm very happy..

Cheers for the MMBasic and the DDSprogram Geoff, and cheers to Peter for the picomite..
Edited 2023-05-04 21:13 by IanRogers
I'd give my left arm to be ambidextrous
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6803
Posted: 03:01pm 04 May 2023
Copy link to clipboard 
Print this post

Very nice!

Now that's working, this looks very interesting. It's an arbitrary wave generator using a Pico with an 8-bit R-2R ladder. By using a PIO to handle the data output he's managed to get it to generate up to 125Msps, which is pretty darn fast! Link
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3805
Posted: 04:24pm 04 May 2023
Copy link to clipboard 
Print this post

  Mixtel90 said  an arbitrary wave generator using a Pico with an 8-bit R-2R ladder. By using a PIO to handle the data output he's managed to get it to generate up to 125Msps, which is pretty darn fast! Link

And 250Msps with CPU speed 250.

Looks doable with MMBasic. Volhout's LA uses PIO & DMA input whereas this uses PIO & DMA output.

The R2R DAC is akin to the PicoMiteVGA green "DAC" but with more pins - right?

John
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6803
Posted: 04:41pm 04 May 2023
Copy link to clipboard 
Print this post

Yep. You can "stretch" a R-2R network to get more bits of resolution.

The maximum frequency will be limited by how fast you can get the DMA to update. The PIO can carry out one instruction per clock cycle, but some instructions can do more than one thing simultaneously. It's a clever little beast. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3805
Posted: 05:38pm 04 May 2023
Copy link to clipboard 
Print this post

The article posted above shows it depends on # bits but with 8-bit can do the speeds already mentioned :)

I wonder if an equivalent MMBasic program would be shorter or longer...

John
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4252
Posted: 05:52pm 04 May 2023
Copy link to clipboard 
Print this post

I wrote an extensive post, but got kicked out the forum again.

So now brief: yes, it can be done.
I already proved that.
But in practical application the pico I/O pins will not provide good logic levels above 60Mhz.

Volhout
Edited 2023-05-05 03:57 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6803
Posted: 06:02pm 04 May 2023
Copy link to clipboard 
Print this post

I suspected it might. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 06:08pm 04 May 2023
Copy link to clipboard 
Print this post

The example in the vid is only ( get me! only) 20Mhz so anything will be better.

This one goes to 5Mhz but at that speed the sine is tiny, the square..... isn't
and the triangle is a sine..
I looked at the signal before the AD8052 and its a smite better but not much.
BUT!!  I am happy with 1Mhz  so it'll do..  

I have been reading a lot abut PIO.. It's pretty powerful and I can see me working on this in the coming months.
I'd give my left arm to be ambidextrous
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4252
Posted: 06:14pm 04 May 2023
Copy link to clipboard 
Print this post

The number of bits depend on how many pins are free on the chip. But 8 bit is a practical value.
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4252
Posted: 06:17pm 04 May 2023
Copy link to clipboard 
Print this post

Fill a circular buffer with samples, and let PIO play this buffer autonomously wher PIO clock determines the output frequency.

Volhout
PicomiteVGA PETSCII ROBOTS
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 06:54pm 10 May 2023
Copy link to clipboard 
Print this post

Update for anyone interested.. Plus 1 question (hopefully for Geoff)

The lil' device works absolutely fine.. I have tweaked the amp as I was clipping well too early.  Setting the max level to 122 rather than the original 211. I still have a relatively decent level change.

The "AM" 1khz seems to work rather well and the sweep is just spot on.

The question. When using weep I can go from 2mS - 2 Secs but it wont cycle round just reboots. TBH I don't care too much as I'll probably never use the sweep, but nice to know it's there.

Other than that. Dandy piece of kit.

@Kevin.  I don't seem to have the issues you are getting. The square wave through the AD8052 gives up the ghost around 400Khz (useable to 100Khz) but the direct output works until 1Mhz so I'm okay there.

I knackered up the box when I was mounting it , so I've ordered another. ( the hammer action on my old Makita just turned on at the most un-opportune moment! LOL!

Cheers everyone.
Edited 2023-05-11 04:54 by IanRogers
I'd give my left arm to be ambidextrous
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 07:07pm 10 May 2023
Copy link to clipboard 
Print this post

Nevermind!

In the code :- " Local SweepTime.steps(5) = (50, 100, 200, 500, 1000, 2000)"

I should imagine the steps should be 6.. I'll try it tomorrow.
I'd give my left arm to be ambidextrous
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3196
Posted: 09:18pm 10 May 2023
Copy link to clipboard 
Print this post

  IanRogers said  Nevermind!

In the code :- " Local SweepTime.steps(5) = (50, 100, 200, 500, 1000, 2000)"

I should imagine the steps should be 6.. I'll try it tomorrow.

No, that is not your problem.  Because the array starts at zero SweepTime.steps(5) has six elements, hence six initialising values.

The sweep setting wraps around for me (on the Micromite) so there must be something different for you.

Geoff
Geoff Graham - http://geoffg.net
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 10:13pm 10 May 2023
Copy link to clipboard 
Print this post

Okay... I'll look elsewhere..

Thanks for responding..  Cool program very crisp in operation.

Cheers
Ian
I'd give my left arm to be ambidextrous
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 07:45am 11 May 2023
Copy link to clipboard 
Print this post

Its worse than I thought actually.

The sweep starts at 500mS then goes to 1S then 2S then it stops for two presses on 2S then freezes.. Reboots then back to 500mS.. It misses 50mS, 100ms and 200mS  completely

I substituted the "sweeptime" variable so I could watch and it is okay.

I re-wrote to change sweeptime to 0 if it goes above 5.. Still the same.
I'd give my left arm to be ambidextrous
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 01:46pm 11 May 2023
Copy link to clipboard 
Print this post

Okay.. tracked down the bug.

As the GUI interrupt doesn't work until instigated, I had left a tiny reference in the for loop in the dosweep() sub.

I replaced it with the correct "touch()" detection and now it doesn't crash.

I suppose the touch interrupt was getting Mucking Fuddled..LOL.

Works absolutely great now.

@ Geoff ( again )  Why the difference in speed when using the sweep facility?
why the need to run the SPI at 10Mhz ~ extremely low speed? wouldn't it work at the higher speed throughout?

Just wondering!
I'd give my left arm to be ambidextrous
 
     Page 3 of 3    
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024