| Menu | JAQForum Ver 19.10.27 |
Forum Index : Microcontroller and PC projects : PicoMite V6.02.01 betas
GP30-GP36 are linked to GP40-GP46 via resistors. GP30-GP36 are currently set to 1 to provide pull up (or they can provide pull down) to GP40-GP46. This allows the whole controller port to be reconfigured as active low or high or ADC for each pin individually in software. If GP32-GP36 aren't being selected for output when using PORT it would certainly tie in with PORT(GP30,7) returning &h03 from the control register if the output register is partially controlled. If the output latches are disabled then GP40-GP46 may well return &h00. I know it's not a hardware problem as I can set GP30-GP36 individually using PIN() and read GP40-GP46 individually, testing them as active low inputs. |
||||||
Mick, Try 60003 or 60100 from geoffs archive. You used this pga before, right? Never noticed this? Volhout Edited 2026-02-17 02:57 by Volhout |
||||||
I'll try some other versions. I've been a bit busy attempting to test other bits. :) No, I don't think I've ever used PORT on any RP2350 before. It's one of those commands that I haven't used much at all really, although I definitely did a couple of times on the RP2040. |
||||||
Been travelling - will check tomorrow |
||||||
Mick, I assume you are using the non-USB version? If so please try the attached and report. PicoMite.zip |
||||||
Yes, it's non-USB. Will do, thanks. |
||||||
Thanks, Peter. That seems to have got PORT working nicely again. :) |
||||||
Not again - ever when using pins > GP31 Here is the fix Before setmask |= (1 << PinDef[pin].GPno); After setmask |= (1ll << PinDef[pin].GPno); |
||||||
V6.02.01b3 PicoMiteRP2040V6.02.01b3.zip All versions Fixes bug in using function calls as parameters to functions or subroutines Corrects behaviour when the A: drive is formatted when the current directory is not at root level RP2350 only Fixes bug in PORT commands and functions when pins > GP31 are used on the RP2350B at the top level Allows blank lines in TYPE definitions Implements FRAME command for writing a text based GUI FRAME_User_Manual.pdf |
||||||
"Everyday the Groundhog greeting..." - Literally translated from the German proverb "Und täglich grüßt das Murmeltier..." ![]() |
||||||
Hi Peter, Is there a reason why in the FRAME user manual some names of the 16 colors are changed, and what is the impact on commands as RGB(Myrtle), RGB(Cerulean). Are the names interchangeable? Volhout |
||||||
Just the manual wrong, I'll update it before the release |
||||||
V6.02.01b4 PicoMiteV6.02.01b4.zip RP2040 - no changes RP2350 Tweaks to flash and param timings to improve reliability. The PGA2350 will run for me at 384MHz with PSRAM enabled The Pico2 will run at 429MHz New command: AUDIO SAMPLE implements ADRS shaping example program ' ============================================================ ' PLAY SAMPLE Demo - ADSR Envelope on a single-cycle waveform ' ============================================================ ' This demo creates a single-cycle sine wave in an integer ' array, then plays it back using PLAY SAMPLE with Attack, ' Decay, Sustain and Release parameters. ' ' Syntax: ' PLAY SAMPLE left%(), right%(), freq, attack, decay, ' sustain, release [,interrupt] ' ' left%(), right%() = single-cycle waveform arrays (INTEGER) ' freq = playback frequency in Hz (10 - 48000) ' attack = attack time in ms (0 - 30000) ' decay = decay time in ms (0 - 30000) ' sustain = sustain level 0 - 100 (percentage) ' release = release time in ms (0 - 30000) ' interrupt = optional label called when release ends ' ' PLAY RELEASE triggers the release phase. ' PLAY STOP stops immediately. ' ============================================================ Option Base 0 Const CYCLE_LEN = 256 ' samples per single cycle Const AMPLITUDE = 32000 ' peak amplitude (16-bit signed) Dim INTEGER left%(CYCLE_LEN - 1) Dim INTEGER right%(CYCLE_LEN - 1) ' --- Build a single-cycle sine wave --- For i% = 0 To CYCLE_LEN - 1 left%(i%) = Int(Sin(2 * Pi * i% / CYCLE_LEN) * AMPLITUDE) right%(i%) = left%(i%) ' mono: same on both channels Next i% ' --- Example 0: Clean sine wave (no envelope shaping) --- ' Full volume, no decay, no release - just a pure tone. ' If this doesn't sound clean, the problem is in the core ' waveform playback, not the ADSR envelope. Print "Playing clean 440 Hz sine for 2 seconds..." Print " Attack=0ms Decay=0ms Sustain=100% Release=0ms" Play Sample left%(), right%(), 440, 0, 0, 100, 0 Pause 2000 Play Stop Print "Done." ' --- Example 0b: Clean sine at 880 Hz (high note check) --- Print "Playing clean 880 Hz sine for 2 seconds..." Print " Attack=0ms Decay=0ms Sustain=100% Release=0ms" Play Sample left%(), right%(), 880, 0, 0, 100, 0 Pause 2000 Play Stop Print "Done." ' --- Example 1: Organ-style (fast attack, long sustain) --- Print "Playing organ tone at 440 Hz..." Print " Attack=10ms Decay=50ms Sustain=80% Release=200ms" Play Sample left%(), right%(), 440, 10, 50, 80, 200, done ' Hold the note for 2 seconds then release Pause 2000 Play Release ' Wait for release to finish Do While SamplePlaying% : Loop Print "Done." ' --- Example 2: Piano-style (fast attack, moderate decay, low sustain) --- Print "Playing piano tone at 262 Hz (middle C)..." Print " Attack=5ms Decay=300ms Sustain=20% Release=500ms" Play Sample left%(), right%(), 262, 5, 300, 20, 500 Pause 3000 Play Release Pause 600 Print "Done." ' --- Example 3: Pad-style (slow attack, high sustain) --- Print "Playing pad tone at 330 Hz..." Print " Attack=800ms Decay=200ms Sustain=70% Release=1500ms" Play Sample left%(), right%(), 330, 800, 200, 70, 1500 Pause 4000 Play Release Pause 1600 Print "Done." ' --- Example 4: Pluck-style (instant attack, fast decay, no sustain) --- Print "Playing pluck at 523 Hz..." Print " Attack=1ms Decay=400ms Sustain=0% Release=100ms" Play Sample left%(), right%(), 523, 1, 400, 0, 100 ' With sustain=0 the note dies naturally after decay Pause 600 Print "Done." ' --- Example 5: Chromatic scale with consistent envelope --- Print "Chromatic scale with string envelope..." Restore scale_data For note% = 1 To 13 Read freq Print " Note"; note%; " freq="; freq; "Hz" Play Sample left%(), right%(), freq, 20, 100, 60, 300 Pause 400 Play Release Pause 100 Next note% Print "Scale complete." ' --- Example 6: Twinkle Twinkle Little Star (piano) --- Print "Playing Twinkle Twinkle Little Star..." Restore twinkle_data For note% = 1 To 42 Read nfreq, dur If nfreq = 0 Then ' Rest Pause dur Else Print " freq="; nfreq; "Hz dur="; dur; "ms" Play Sample left%(), right%(), nfreq, 5, 150, 30, 100 Pause dur Play Release Pause 100 EndIf Next note% Print "Tune complete." End done: ' Interrupt handler for end of release SamplePlaying% = 0 IReturn ' Frequencies for one chromatic octave (A4 to A5) scale_data: Data 440.0, 466.2, 493.9, 523.3, 554.4, 587.3, 622.3 Data 659.3, 698.5, 740.0, 784.0, 830.6, 880.0 ' Twinkle Twinkle Little Star - C major (traditional, public domain) ' Each pair: frequency (Hz), duration (ms) ' C=261.6 D=293.7 E=329.6 F=349.2 G=392.0 A=440.0 ' Line 1: C C G G A A G- twinkle_data: Data 261.6, 350, 261.6, 350, 392.0, 350, 392.0, 350 Data 440.0, 350, 440.0, 350, 392.0, 700 ' Line 2: F F E E D D C- Data 349.2, 350, 349.2, 350, 329.6, 350, 329.6, 350 Data 293.7, 350, 293.7, 350, 261.6, 700 ' Line 3: G G F F E E D- Data 392.0, 350, 392.0, 350, 349.2, 350, 349.2, 350 Data 329.6, 350, 329.6, 350, 293.7, 700 ' Line 4: G G F F E E D- Data 392.0, 350, 392.0, 350, 349.2, 350, 349.2, 350 Data 329.6, 350, 329.6, 350, 293.7, 700 ' Line 5: C C G G A A G- Data 261.6, 350, 261.6, 350, 392.0, 350, 392.0, 350 Data 440.0, 350, 440.0, 350, 392.0, 700 ' Line 6: F F E E D D C- Data 349.2, 350, 349.2, 350, 329.6, 350, 329.6, 350 Data 293.7, 350, 293.7, 350, 261.6, 700 |
||||||
Are you currently building a YAMAHA DX7 clone, or are you planning to? ![]() |
||||||
Peter You're making me crazy with joy :-) PLAY SAMPLE is a dream. PS: Did you see my question in the other thread about the graphics for your Raycaster demo? Can you upload them here? Thanks! Matthias |
||||||
Hi Peter, Just loaded B4 onto a Pico 2 2350 LCD and it's runing flat out at 420MHz with no apparent problems. |
||||||
420MHz!! John |
||||||
A few things I noticed with V6.02.01b4. When I use Input$() in the editor, it changes to Input $() after saving. When I play an MP3 with quick transitions, some passages become distorted. I thought about setting the frequency higher, but that doesn't work anymore. I've tried various frequencies. Error message: > option cpuspeed 200000 [39] CSub Error: Invalid identifier PicoMite MMBasic RP2350A V6.02.01b4 OPTION SYSTEM I2C GP20, GP21 OPTION FLASH SIZE 4194304 OPTION COLOURCODE ON OPTION HEARTBEAT OFF OPTION PICO OFF OPTION CPUSPEED (KHz) 200000 OPTION DISPLAY 50, 100 OPTION SD CARD GP22, GP6, GP7, GP4 OPTION AUDIO I2S GP2, GP5, ON PWM CHANNEL 11 OPTION RTC AUTO ENABLE OPTION MODBUFF ENABLE 192 OPTION F1 help 'The function keys have been modified with the necessary OPTION F5 list commands '"+" and chr$(13) functions. OPTION F6 list functions OPTION F7 list pins OPTION F8 option list OPTION F9 flash run 1 'This starts the minifm_RC2.bas Note: The Raspberry Pi Pico 2W is mounted on an Olimex board with female connectors, omitting the HDMI on the Olimex and the Wi-Fi module on the Raspberry Pi Pico 2W PCB. A DS3231+EEPROM is also mounted under the Olimex PCB. The I2S DAC PCM5102A from the manual fits exactly upside down under the PicoMate, and the LINE OUT connector is still easily accessible. I did insert a template to prevent short-circuits, and the markings indicate the correct pinouts. Jan. Edited 2026-02-19 09:21 by JanVolk |
||||||
Are you using input$ as a variable name? If so that is the issue, it is conflicting with the command input |
||||||
Peter, Thanks for the reply. The first problem came to light in the help file. Your reasoning is indeed correct. > help input Input ["prompt$";] var1 [,var2[,var3[,etc.]]] Input #nbr, list of variables ' Input$(nbr, [#]fnbr) The second problem might have arisen earlier when overloading the A: drive with an .mp3 file? Only a report that the A: drive was full and the .mp3 was 0 KB and deleted with kill. Perhaps something broke after that? Tried again today, first with Clear_Flash_RP2350.uf2 and an MP3 test at 200 MHz with the same result. Then I set the CPU speed to 300 MHz and the problem disappeared. Fast MP3 transitions now play correctly. > option list PicoMite MMBasic RP2350A V6.02.01b4 OPTION SYSTEM I2C GP20,GP21 OPTION FLASH SIZE 4194304 OPTION COLOURCODE ON OPTION CPUSPEED (KHz) 300000 OPTION DISPLAY 50, 100 OPTION SDCARD GP22, GP6, GP7, GP4 OPTION AUDIO I2S GP2,GP5', ON PWM CHANNEL 11 OPTION RTC AUTO ENABLE OPTION MODBUFF ENABLE 192 OPTION F1 help OPTION F5 list commands OPTION F6 list functions OPTION F7 list pins OPTION F8 option list OPTION F9 flash run 1 Have a nice day, Jan. |
||||||
| The Back Shed's forum code is written, and hosted, in Australia. |