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 : PicoMite: Another PLAY SOUND bug ?
Page 1 of 2 | |||||
Author | Message | ||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4047 |
Hi Peter, I assume I'm just having some sort of mental breakdown, but with b28: Option Base 0 Option Explicit On Option Default None ' Why (if uncommented) does this do nothing ? 'Play Sound 1,B,S,256,25 'Do : Pause 1000 : Loop ' But this play Middle-C ? Do Play Sound 1,B,S,256,25 Pause 1000 Loop Best wishes, Tom Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9139 |
Works for me |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4047 |
Seriously, I can see on the scope that it's doing nothing: Play Sound 1,B,S,256,25 Do : Pause 1000 : Loop > option list PicoMite MMBasic Version 5.07.07b28 OPTION SYSTEM SPI GP18,GP19,GP16 OPTION CPUSPEED (KHz) 252000 OPTION LCDPANEL ILI9341, RLANDSCAPE,GP20,GP21,GP17 OPTION SDCARD GP22 OPTION AUDIO GP6,GP7, ON PWM CHANNEL 3 Best wishes, Tom Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
hitsware2 Guru Joined: 03/08/2019 Location: United StatesPosts: 713 |
Doesn't Do : Pause 1000 : Loop Simply loop the pause 1000 ? my site |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4047 |
Yes it does, I'm just doing something so the program doesn't end. The behaviour is the same (no tone) with just DO : LOOP after the PLAY SOUND. Best wishes, Tom Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9139 |
PicoMite.zip |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4047 |
Quick test ... same nothing. Will try again later or tomorrow, but my free time has expired for the moment, need to feed the troops. Best wishes, Tom Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9139 |
Oops - sorry, wrong version PicoMite.zip |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4047 |
Thanks Peter, that fixes the issue . Tom Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
mozzie Regular Member Joined: 15/06/2020 Location: AustraliaPosts: 68 |
G'day Peter I may be asking a bit much from the play sound function, but if I attempt to run two white noise sources: >Play Sound 1,b,n,1 >Play Sound 2,b,n,2 The Pico locks up / requires power cycle. Also 3 tones plus white noise source: >Play Sound 1,b,n,1 >Play Sound 2,b,t,420 >Play Sound 3,b,t,525 >Play Sound 4,b,t,740 The Pico locks up / requires power cycle. If only the left channel is used it functions as normal. Only require 2 white noise sources to increase output modulation, am I correct in thinking the output is 25% for 1 sound, 50% for 2, 75% for 3 and 100% for all 4? I imagine there is a fair bit going on in the background to get 8 signals across 2 channels (4x2) simultaneously at 44Khz PWM, including all the lookup table calls etc. Not surprising the processor load is fairly high Can you please also advise if you think inverting the 2nd channel: Poke Short &h40050000,&h09 Is likely to cause any problems. Running PicoMite 5.070729 but also 5.070728 is the same. Regards, Lyle. Edited 2023-03-28 00:10 by mozzie |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9139 |
Mozzie - what happens at 252MHz CPU speed? |
||||
mozzie Regular Member Joined: 15/06/2020 Location: AustraliaPosts: 68 |
Cheers Peter, Can confirm at 252MHz 3 white noise sources in parallel or 1 white noise plus 3 sine or triangle. Also tried 315MHz and 4 white noise or any combination of types. The answer should have been "jumping off the screen" but couldn't see the woods for the trees Thanks again for the excellent work . Regards, Lyle. P.S. so far using Poke Short &h40050000,&h09 to invert the output is working ok but I'll keep testing. |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9139 |
Have found a fix at normal clock speed 4*noise now works fine on both channels. Watch for b29 being posted |
||||
mozzie Regular Member Joined: 15/06/2020 Location: AustraliaPosts: 68 |
Cheers Peter, Maybe a thought / suggestion for a later time... The ability to allow a single Play Sound output at 100% modulation to match play tone, I realise this may take significant work to ensure that if more than 1 sound is running the output is not overdriven, I currently run 1-3 in parallel so not really needed but would be handy. Thanks again. Regards, Lyle. |
||||
phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2141 |
"so far using Poke Short &h40050000,&h09 to invert the output is working ok" @mozzie Also works with beta 10. Are other phase shifts possible? If so it could also be useful for non-audio applications. A variable speed inverter for a split-phase motor would need 90 deg. An open delta inverter for a 3 phase motor would need 60 deg. Even if it is only possible to get 180 deg. it would still be handy for a single phase unit. |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9139 |
This is all already covered in enhancements to the PWM command in the 7.07.07 betas. Edited 2023-03-28 21:58 by matherp |
||||
phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2141 |
Yes it is, and thankyou for that. It is excellent for modified square wave inverters of all types. Play Tone makes sine wave inverters a piece of cake. Output feedback goes to Play Volume. The 180 deg. trick makes H-bridge driving easier. More phase shifts would open up more possibilities so was interested to know if Poking other values would work. If not I don't expect you to modify the code. Very few people would use it. PS. Thanks for the Library. That will be useful to many people. |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3816 |
&h40050000 is (in C) 0x40050000 which is PWM_BASE in RP2040 datasheet See 4.5.3 for the registers. The web has comments on using the registers, too, e.g. search on Pico 0x40050000 or RP2040 0x40050000 John Edited 2023-03-29 00:10 by JohnS |
||||
stanleyella Guru Joined: 25/06/2022 Location: United KingdomPosts: 2134 |
4.7mH inductors arrived today so built the low pass filter and tried play tone 1000,500,2000 it worked! Check the photos of the ebay £14 stereo, runs off battery/usb, rechargable. Womans voice says blue tooth mode when turned on then pressing mode says fm mode, pressing again says a u x mode which I'm using, next says u s b mode. Great for the price. I didn't have the caps for the filter so 68nF was 47nF + 22nF in parallel. 33nF was 22nF + 10nF in parallel, 2.7nF was 2.2nF+ (1nF + 1nF in series) in parallel, would have been simpler with the right caps... see the photo but sounds seem ok, I'm happy my soldering with my vision it worked. |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4256 |
Copy some cd music to the sd card. You'll be surprised of the sound quality of this 4 dollar pico. Volhout PicomiteVGA PETSCII ROBOTS |
||||
Page 1 of 2 |
Print this page |