|
Forum Index : Microcontroller and PC projects : PicoMite V6.02.01 betas
| Author | Message | ||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8564 |
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 Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 5703 |
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 PicomiteVGA PETSCII ROBOTS |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8564 |
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. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10965 |
Been travelling - will check tomorrow |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10965 |
Mick, I assume you are using the non-USB version? If so please try the attached and report. PicoMite.zip |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8564 |
Yes, it's non-USB. Will do, thanks. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8564 |
Thanks, Peter. That seems to have got PORT working nicely again. :) Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10965 |
Not again - ever when using pins > GP31 Here is the fix Before setmask |= (1 << PinDef[pin].GPno); After setmask |= (1ll << PinDef[pin].GPno); |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10965 |
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 |
||||
| bfwolf Senior Member Joined: 03/01/2025 Location: GermanyPosts: 166 |
"Everyday the Groundhog greeting..." - Literally translated from the German proverb "Und täglich grüßt das Murmeltier..." |
||||
| Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 5703 |
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 PicomiteVGA PETSCII ROBOTS |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10965 |
Just the manual wrong, I'll update it before the release |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10965 |
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 |
||||
| bfwolf Senior Member Joined: 03/01/2025 Location: GermanyPosts: 166 |
Are you currently building a YAMAHA DX7 clone, or are you planning to? |
||||
| homa Guru Joined: 05/11/2021 Location: GermanyPosts: 539 |
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 |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |