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 KingdomPosts: 151 |
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 KingdomPosts: 6800 |
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 KingdomPosts: 3805 |
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 KingdomPosts: 6800 |
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 KingdomPosts: 3805 |
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: NetherlandsPosts: 4251 |
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 KingdomPosts: 6800 |
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 KingdomPosts: 151 |
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: NetherlandsPosts: 4251 |
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: NetherlandsPosts: 4251 |
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 KingdomPosts: 151 |
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 KingdomPosts: 151 |
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: AustraliaPosts: 3196 |
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 KingdomPosts: 151 |
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 KingdomPosts: 151 |
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 KingdomPosts: 151 |
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 |