Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 22:53 28 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 1 of 3    
Author Message
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 09:14am 25 Apr 2023
Copy link to clipboard 
Print this post

Howdy.
On Geoff's web site there is a piccy of the DDs frequency generator and a pico.

Is there a basic program with the pico as the target? I can rewrite it, but if it is there , so to speak ?

Cheers
Ian
Edited 2023-04-25 19:14 by IanRogers
I'd give my left arm to be ambidextrous
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3196
Posted: 09:46am 25 Apr 2023
Copy link to clipboard 
Print this post

I have not tested it on the PicoMite but it should work exactly the same - no rewriting required except for changing the I/O pin allocations and initialising the SPI channel.

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

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 10:19am 25 Apr 2023
Copy link to clipboard 
Print this post

Well lets test it then!
Just have another AD9833 coming as the one I had was the smaller (blue) model and I need the green one.

Cheers
I'd give my left arm to be ambidextrous
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 512
Posted: 06:45pm 26 Apr 2023
Copy link to clipboard 
Print this post

Hi I did this last year.
link to forum topic Function Generator.
I made it fit a 480x320 screen, simply because I had a surplus of them, if you want a different resolution you'll need to re-jig the layout. I'd be interested to see if you get the same sort of distortion I was getting on the Square wave and triangle wave at higher frequencies.
Regards Kevin.
Edited 2023-04-27 04:54 by Bleep
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 11:01am 27 Apr 2023
Copy link to clipboard 
Print this post

Very nearly... However! I have an error message

Line: "OPEN SPI 100000, 2, 16"

Yeilds "Not all pins set for SPI"

But the screen is on and working?
I'd give my left arm to be ambidextrous
 
IanRogers

Senior Member

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

  Geoffg said  I have not tested it on the PicoMite but it should work exactly the same - no rewriting required except for changing the I/O pin allocations and initialising the SPI channel.

Geoff

Also font #7 cannot be redefined, so I made it font #9

Hopefully it wont mess with anything
I'd give my left arm to be ambidextrous
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 11:36am 27 Apr 2023
Copy link to clipboard 
Print this post

Just swapped for spi2 using GP26, 27 and 28
SETPIN GP28,GP27,GP26, SPI2

Same error message. "Not all pins set for SPI2"
Edited 2023-04-27 21:37 by IanRogers
I'd give my left arm to be ambidextrous
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3805
Posted: 12:07pm 27 Apr 2023
Copy link to clipboard 
Print this post

I suspect to have any chance of a useful reply you need to provide your option list and the program listing at least up to the error line.

Also, VGA or non-VGA.

John
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 12:21pm 27 Apr 2023
Copy link to clipboard 
Print this post

Okay.. Non VGA  I have tried version 5.0704 5.0705 and 5.0706

> option list
OPTION SYSTEM SPI GP18,GP19,GP16
OPTION AUTORUN ON
OPTION LCDPANEL ILI9341, LANDSCAPE,GP14,GP15,GP13
OPTION TOUCH GP12,GP11
GUI CALIBRATE 0, 3868, 3847, -911, -653
OPTION SDCARD GP22
>
Everything else is Geoff's code.
Edited 2023-04-27 22:23 by IanRogers
I'd give my left arm to be ambidextrous
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9131
Posted: 12:36pm 27 Apr 2023
Copy link to clipboard 
Print this post

Works perfectly  for me

setpin gp26,gp27,gp28,spi2
spi2 open 1000000,3,8


Note: if you use SPI2 CLOSE then you will need to re-allocate the pins again using setpin
Edited 2023-04-27 22:39 by matherp
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 12:42pm 27 Apr 2023
Copy link to clipboard 
Print this post

I dont want to use SPI2  If I use Geoff's code must I not use SPI close??
I'd give my left arm to be ambidextrous
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 12:50pm 27 Apr 2023
Copy link to clipboard 
Print this post

Peter!

Take the DDS generator bas file and load it into a pico..
Change the FSY and CS to suit and the SPI command is always opened then closed with every function.

I should imagine the pico doesn't work like that!!

The level change and AM changes are both the same.

If I want to use SPI 1 then I'll have to keep it open. BUT the report is still the same  "Not all pins set for SPI"
I'd give my left arm to be ambidextrous
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3805
Posted: 12:52pm 27 Apr 2023
Copy link to clipboard 
Print this post

So you still have such as

CPU 48

and the pins CS, FSY, TrigPin as 17, 18, 16?

John
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 12:58pm 27 Apr 2023
Copy link to clipboard 
Print this post

Nope

cpu 48 remmed out

CS FSY and TriPin are now on GP8, 9 and 10
Edited 2023-04-27 22:59 by IanRogers
I'd give my left arm to be ambidextrous
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 01:14pm 27 Apr 2023
Copy link to clipboard 
Print this post

Gonna give up for a bit.

Using LOAD "" to get the bas file from the SD card !!Great.

After manipulation of the file I typed SAVE "gen.bas"

Error... Low level error on SD... Now the SD card was missing in action.

I'm going through my circuit to see if I can find anything.
Edited 2023-04-27 23:15 by IanRogers
I'd give my left arm to be ambidextrous
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6101
Posted: 09:44pm 27 Apr 2023
Copy link to clipboard 
Print this post

SPI CLOSE is in 4 lines.
419,453,483 and 499
That means that there are 4 SPI opens.
I noticed that the SPI speed changes at least once so I would strongly suggest that you do use SPI2 and leave the system SPI alone.

CPU 48 is in more than one location also.

No time to assemble a working unit today.

Jim
VK7JH
MMedit   MMBasic Help
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 512
Posted: 09:53pm 27 Apr 2023
Copy link to clipboard 
Print this post

I've already done all this for you, all you need to do is resize the screen to whatever lcd resolution you want or use 380x320!
Regards Kevin.
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 06:59am 28 Apr 2023
Copy link to clipboard 
Print this post

Hi Jim  

Tried that but it still complains about SPI2 not all pins are setup.

I have an ILI9341
The SD card will not write but will read. screen is fine and touch is fine.

its weird..  One of those issues when I find it it'll be something blatantly obvious.


Kevin!  Tried to look for your code.  It isn't on those two pages you link in.

I have scrubbed the pico reinstalled the 5.0706 UF2 and the SD still wont save even with a basic program... It saves to A: (flash) but wont save to the SD.

I have tried four or five SD cards normal and micro  same.

The error is:-

> list
Text 0,0 "ALEXIA" ,,3,2
> drive "B:"
> files
B:/
08:50 26-04-2023      48073  SigGenerator.bas
0 directories, 1 file
> save "genny.bas"
Error : A hard error occurred in the low level disk I/O layer
>
I'd give my left arm to be ambidextrous
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6101
Posted: 08:06am 28 Apr 2023
Copy link to clipboard 
Print this post

The link to Kevin's code is in his first post as a ZIP

It is well worth getting as is solves a number of compatibility issues.

As it happens my setup uses SPI2 for system so I used SPI for the module.

I have a non-responding MCP41010 chip so can't change the level.
I need to look closer at the traces etc.

Jim
VK7JH
MMedit   MMBasic Help
 
IanRogers

Senior Member

Joined: 09/12/2022
Location: United Kingdom
Posts: 151
Posted: 08:15am 28 Apr 2023
Copy link to clipboard 
Print this post

Okay... Bit of a penny dropped.

SPI on the screen isn't any thing to do with the SPI command I'm trying to use.

I was connecting to the same SPI pins Ergo the builtin commands for the SD, screen and touch deal with open close and setpins.

If I set up SPI for the AD9833 module   I have to do that individually..

A bit different to the MicroMite.

LATER!!!

I have it nearly working.. The SD card still barfs but I have the program on A

Swapped the AD9833 to SPI2 ( thanks Jim) it'll be better I'm sure.
BUT!! this line

"SetPin Peek(byte Peek(word &H9D000090) + 23), INTL, MyInt"  went way over.

At the end it said "Setpin 15 off"  but pin 15 isn't on the schematic??
I'd give my left arm to be ambidextrous
 
     Page 1 of 3    
Print this page
© JAQ Software 2024