Shop OBEX P1 Docs P2 Docs Learn Events
SERout for MIDI problems — Parallax Forums

SERout for MIDI problems

RicksterRickster Posts: 3
edited 2007-01-12 00:59 in BASIC Stamp
I am trying to make a bank changer in MIDI and was reading the N&V issue 94. after unsucsessfuly trying this project with my keybord i'm at a loss as to why it wont work and i need som help trobleshooting this. It should be fairly easy.

BS2p24 chip
I connected io pin 15 to 500 ohm's and an led to ground to test the output, it comes on.

the original program was writen for a difrent chip but my baud rate shoud be 60 to get 31,500 baud, orginal was 20 in the program.
I hooked pin 5 of the midi cable to pin 15 and pin 4 to +5vdc and pin 2 to ground. I have quadruple checked this. I have also reversed pins 4 and 5 as I read somewher that it was wrong. nether orientation works.
My program looks like this to test it -

'·· {$STAMP BS2p}
'·· {$PBASIC 2.5}

MidiOut········ PIN···· 15····················· ' midi serial output
MidiBaud······· CON···· $8000 +·60············· ' 31.25 kBaud -- open

Main:
· DO
····· SEROUT MidiOut, MidiBaud, [noparse][[/noparse]$90, $3C, $7F]
······PAUSE 500
· LOOP
· END
This should send a signal to play the note every half second, but I get nothing. What am I missing?

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-01-08 16:39
    Rickster,

    Do you have the resistors listed? Without them a wiring mistake could cause damage. You may want to verify the data is getting to the other end of the cable. This would be easier if you have a meter or scope.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • RicksterRickster Posts: 3
    edited 2007-01-11 22:53
    Yes I had 220 ohm resisters on pin 4 and 5.

    I found the problem earlyer today. It would seem that my cable is bad at some point with an intermitint open connection when bent just a bit neer the plug, its molded so i had to replace it with the other half i choped off earlyer. sad part is its only 3" long [noparse]:)[/noparse]

    I can get my chanel to change now with -
    SEROUT MidiOut, MidiBaud, [noparse][[/noparse]$C0, $11]
    works great, need to find the command for the foot controller and find a good foot pedal i can use with a pot in it for the foot control of the wha in the preamp yet. Lots of the documentation on midi is fairly·easy but not very concise.

    I think the foot controler· [noparse][[/noparse]$B0, $24, $00 to ·$7F] will work to control it but the midi documentation·has $04, $24, $0B or $2B for the foot control and I cant seem to find rocktron midi tables. I'll have to run through them to see.

    Post Edited (Rickster) : 1/12/2007 12:51:23 AM GMT
  • RicksterRickster Posts: 3
    edited 2007-01-12 00:59
    This code changes to patch 37 then moves into a few loops to change the center Frequency of the wah through midi. I can get the patch to change but the wha isn't working yet. My question is SEROUT MidiOut, MidiBaud, [noparse][[/noparse]$B0, $04, HEX fCenter] correct in stating HEX fCenter or do I need to add HEX #fCenter to output it correctly. The Debug showes me what i'm looking for 00-7F in hex.
    I could be wrong in the mapping for the foot controler also, its simple just not documented yet.
    '   {$STAMP BS2p}
    '   {$PBASIC 2.5}
    MidiOut         PIN     15                      ' midi serial output
    MidiBaud        CON     $8000 + 60              ' 31.25 kBaud -- open
    fCenter         VAR     Byte
    Main:
        SEROUT MidiOut, MidiBaud, [noparse][[/noparse]$C0, $24]
          PAUSE 100
          fCenter = $00
          DEBUG HEX fCenter
    DO
    PAUSE 100
          DO
            SEROUT MidiOut, MidiBaud, [noparse][[/noparse]$B0, $04, HEX fCenter]
            fCenter = fCenter + $01
            DEBUG HEX fCenter, CR
            PAUSE 5
          LOOP  UNTIL fCenter = $7F
    PAUSE 100
          DO
            SEROUT MidiOut, MidiBaud, [noparse][[/noparse]$B0, $04, HEX fCenter]
            fCenter = fCenter - $01
            DEBUG HEX fCenter, CR
            PAUSE 5
          LOOP UNTIL fCenter = $01
    LOOP
    END
    
Sign In or Register to comment.