-
Roland SP-404 sampler
I've been using a 16F877 to try to send ordinary MIDI commands (note on, note off) to a Roland SP-404 sampler in response to push button presses. So far, no luck. Here are my commands for a test program:
DEFINE OSC 20
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
DEFINE HSER_BAUD 31250
START: HSEROUT [HEX 144, HEX 71, HEX 127]
pause 1000
goto start
The MIDI format in the specs is:
9nH kkH vvH
n=MIDI channel, kk=note number, and vv= note velocity.
The PIC runs at 20 mHz, so I configure the compiler to program at oscilator XT setting. The scope shows serial data coming out of the PIC at 1 sec intervals. The sampler is correctly loaded with sound files, and it plays well manually. I transmit on channel 1. The sampler plays correctly with an external MIDI keyboard. However, on the scope, the baud rate of the external keyboard is significantly faster than the baud rate of the PIC output.
Does anyone have any ideas?
Ian
-
MIIP. You must set the oscillator to HS mode first.
try change your DEFINEs to those..
Code:
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
DEFINE HSER_SPBRG 39 ' 31250 Bauds
using that, and with my calc, i promise it gives you 0% of error percentage... for a perfect 20MHZ clock so far. I don't know how PBP calculate it but try it first.
NOW, also try to change...
Code:
HSEROUT [HEX 144, HEX 71, HEX 127]
to
Code:
HSEROUT [$144, $71, $127]
about now?
Are you sure that 144 must be the a HEX value? Could those value be decimal?
-
designer
Thanks, Steve.
I will try those suggestions, shortly. Meanwhile, I forgot I am currently using Serout2 in my testing. I had been using Hserout, but for some reason, the PIC now hates Hserout, and won't execute it, while it seems happy with Serout2. Any ideas?
Ian
-
well i can't say, it always worked fine for me in the past using that chip. My best bet as now is the config fuse setting... maybe the hardware
what is the working SEROUT2 line?