Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 14:42 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 : Getting the best out of Pico ADC

     Page 9 of 17    
Author Message
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 02:04pm 25 Aug 2023
Copy link to clipboard 
Print this post

Well, first I'd like any comments on them. After all, I've only taken a guess at what you may be after. I didn't get my Mindreader badge in the scouts.  :)

For one with a battery, how would you switch it off?
By the way, I found the case Here.
Mick

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

Joined: 17/05/2016
Location: United States
Posts: 3150
Posted: 03:27pm 25 Aug 2023
Copy link to clipboard 
Print this post

  Mixtel90 said  I found the case Here.


Hammond box 1593KBK also available from digikey.com and digikey.ca.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2129
Posted: 05:19pm 25 Aug 2023
Copy link to clipboard 
Print this post

@Volhout, thanks for the code, I will study it. Lots of new ideas and mmbasic commands.
Mick, is that a "pico scope" board?
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 06:14pm 25 Aug 2023
Copy link to clipboard 
Print this post

That's the general idea, Stan. How someone actually decides to use it is up to them though, as usual. It's designed around the NPHighview software, but I made the test output 1Vp-p at full output level.

I've just added corner fixing holes to the cased version PCB. They may help with mounting it in the lid of the box.
Mick

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

Senior Member

Joined: 02/09/2020
Location: United States
Posts: 200
Posted: 12:11am 26 Aug 2023
Copy link to clipboard 
Print this post

Hi, Mick -
First of all, those are beautiful PCB layouts!

I've made one change since my earlier code dump. Here it is, plus some other thoughts, and the reasons for them:

1. I've shifted button inputs from GP15, GP14, and GP13 to GP14, GP13, and GP10. I have a copy of the Adafruit Pico pin map; it says not to use GP15 / pin 20 (for unknown reason). All other intervening pins are in use for various board functions.

2. Rather than have a switch to select AC or DC inputs, I just have the input line run to the jack, and will capacitively isolate (with the pull-up and pull-down resistors) externally. Thus far, I haven't added any resistors or other protection to the input on pin 31. Living dangerously works for me, but I appreciate you being more careful.

3. As you did in your board layouts, I just have it brought out to a test point (red socket) accessible to the input "probe". Same goes for output protection on pin 24 - living dangerously.

4. Personally, I'm not using a power switch, as I have a tiny LiPo battery directly connected to the JP2 receptacle on the RP2040-LCD-0.96 board. While the board is plugged in to a USB-C cable, the scope is operating and also charging the battery. When I want to isolate the ground, I'm just unplugging it from the USB-C cable, and it runs for two or three hours (!) on the LiPo battery.

In these photos, I've just made all the connections between the switches, jacks, and the board via soldered wires (at the switch / jack end) and female header connectors (at the board end). The wooden case was cut on my neighbor's laser cutter, and I've mounted the board inside using Sugru, not the most elegant solution in the world. I *do* very much like the notion of front-mounting the PCB with the RP2040 board installed on it.





My intent is to paint the wood, then put labels on the jack, test point, and buttons.
Edited 2023-08-26 10:14 by NPHighview
Live in the Future. It's Just Starting Now!
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 07:32am 26 Aug 2023
Copy link to clipboard 
Print this post

Nice box! You don't need my design now. :)

1. You can't use GP8, GP9, GP10, GP11, GP12 or GP25 as these are used for the display (and GP25 doesn't come out to a pin anyway, it's normally thee on-board LED).
I can't see where GP13, GP14 or GP15 are used on the module...?

2a. If you don't want the AC/DC switching leave off the cap, button and 4k7 resistors. Link the bottom two holes where the button goes. Done. :)

2b. I'm very loath to have a flying lead on an ADC pin without protection. For static reasons if nothing else. It costs virtually nothing to do and the idiot that finds 9V on the probe instead of the expected 3V may not blow the Pico up. If you *must* live dangerously fit a link instead of the 2k2 resistor and leave off the BAT85 diodes. :)

3. The attenuator on the output test signal isn't for protection, it's to drop it to the standard 1V level that you usually find. You can, of course, mess with the values or even link the 1k8 and omit the 820 if you want the full 3V3. I like a lower level that can be used for simple audio testing (and can be fed into a 8R earpiece without damaging the Pico, of course).
Edited 2023-08-26 18:34 by Mixtel90
Mick

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

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 08:34am 26 Aug 2023
Copy link to clipboard 
Print this post

Since you measure only low frequency signals, you can add simple protection with a 10k series resistor between pin 31 and the test pin..

Volhout
Edited 2023-08-26 18:35 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 08:39am 26 Aug 2023
Copy link to clipboard 
Print this post

The holes in the board cost nothing. Everything is optional. :)
Mick

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

Joined: 18/11/2011
Location: United Kingdom
Posts: 3804
Posted: 08:41am 26 Aug 2023
Copy link to clipboard 
Print this post

  Mixtel90 said  Any use to anyone?

Very possibly. I figured it was a 'scope (but have no ideas its abilities & limitations).

Is there a circuit diagram please? Helps me grasp things (a bit).

Does it matter which display it would connect to?

Unfortunate timing - I recently sent off to jlc & could've added this LOL

John
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 09:07am 26 Aug 2023
Copy link to clipboard 
Print this post

It uses a Waveshare RP2040-LCD-0.96 board (which I haven't got so I'm working from the spec). It has an on-board dosplay, nothing else required.
The software is from earlier in this thread, from NPHighview. It's a basic single-channel low frequency 'scope.
No circuit just at the moment as things are still in a state of flux. lol
Mick

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

Joined: 18/11/2011
Location: United Kingdom
Posts: 3804
Posted: 09:30am 26 Aug 2023
Copy link to clipboard 
Print this post

Could it use an ordinary Pico (or W) board & another (larger!) display?

John
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 10:10am 26 Aug 2023
Copy link to clipboard 
Print this post

Probably, it's only an SPI display. However, the software would need a lot of work for changes in resolution, I think. I'm only the hardware bod, I don't know too much about the software.

This is the board but you may find it a bit cheaper elsewhere (although postage is included here).
Edited 2023-08-26 20:16 by Mixtel90
Mick

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

Joined: 17/05/2016
Location: United States
Posts: 3150
Posted: 11:27am 26 Aug 2023
Copy link to clipboard 
Print this post

  JohnS said  Unfortunate timing - I recently sent off to jlc & could've added this LOL


Slow boat shipping from JLCPCB (to North America, at least) is now so cheap ($1.44USD) that I don't bother to bundle. Different, of course, if you have chosen express shipping--I only do that about once a year, if that.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 11:47am 26 Aug 2023
Copy link to clipboard 
Print this post

Also, you only get one board design at the cheap rate. A second design on the same order costs more.
Mick

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

Joined: 18/11/2011
Location: United Kingdom
Posts: 3804
Posted: 12:00pm 26 Aug 2023
Copy link to clipboard 
Print this post

  lizby said  
  JohnS said  Unfortunate timing - I recently sent off to jlc & could've added this LOL


Slow boat shipping from JLCPCB (to North America, at least) is now so cheap ($1.44USD) that I don't bother to bundle. Different, of course, if you have chosen express shipping--I only do that about once a year, if that.

I chose the cheapest but it was far more than for you!  (I estimate about $8 but I ordered 2 different sets of 5 boards so maybe it would've been a bit more than half that?)

John
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3804
Posted: 12:01pm 26 Aug 2023
Copy link to clipboard 
Print this post

  Mixtel90 said  Also, you only get one board design at the cheap rate. A second design on the same order costs more.

Yes. But one lot of shipping, which saves some.

John
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3804
Posted: 12:07pm 26 Aug 2023
Copy link to clipboard 
Print this post

  Mixtel90 said  Probably, it's only an SPI display. However, the software would need a lot of work for changes in resolution, I think. I'm only the hardware bod, I don't know too much about the software.

This is the board but you may find it a bit cheaper elsewhere (although postage is included here).

I'm not much worried by the software - so long as MMBasic supports the display (or I use the VGA one).

I'd like a decent-size display, though (at least I think so).

I'd guessed it would be any Pico board rather than that one. No worries.

John
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2129
Posted: 01:58pm 26 Aug 2023
Copy link to clipboard 
Print this post

I think the code would be easy to convert to ili9341 as it uses screenresx and y not screen size.
There's lots of code to scan and lots of subs. Just buffers need resizing for larger display. The touch area command could be the buttons.
Maybe a larger display will show it's pixels only not joined pixels.
It should be easy to convert to vga.
Edited 2023-08-27 00:04 by stanleyella
 
NPHighview

Senior Member

Joined: 02/09/2020
Location: United States
Posts: 200
Posted: 02:13pm 26 Aug 2023
Copy link to clipboard 
Print this post

Thanks for all the comments!

I specifically set about doing this so that other displays could be used, even VGA on a Colour Maximite 2. I tried to be very careful about identifying sections of code that were dependent on the RP2040-LCD-0.96, and of course there will be some variations of MATH libraries, framebuffer memory capacity, etc. on other boards.

Mick has sensibly added protection circuitry to the inputs and scaling circuitry to the test signal output, but here is my "barebones" circuit diagram:



Unfortunately, the RP2040-LCD-0.96 doesn't have a touch screen. That would eliminate the need for the external pushbutton switches.

The PicoScope code runs pretty much without any changes on a Waveshare Pico-Eval-Board, but you need to set up its display appropriately with OPTION commands. Unfortunately, the P-E-B doesn't have i/o connections run out to accessible connectors. On the P-E-B, I set the analog input to that of the light-dependent resistor ("LDR" in the circuit diagram), and blink NeoPixels at it to view the resulting waveform.

This all started out for me as an exercise in exploring PicoMite and WebMite variants of MMBASIC, and has since taken on a life of its own.
Live in the Future. It's Just Starting Now!
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 03:09pm 26 Aug 2023
Copy link to clipboard 
Print this post

I'm still confused. Why can't you use GP15 (pin 20)? It doesn't go anywhere on the board that I can see. I can't test it, obviously. and you seem to have been using it previously.


EDIT
It seems that avoiding GP15 was an Adafruit recommendation on early versions of Circuit Python (also applied to micropython) running on an early SDK (prior to 1.2, but I don't know which). It was fixed a year or so ago by a SDK patch.
.
Edited 2023-08-27 02:28 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
     Page 9 of 17    
Print this page
© JAQ Software 2024