Bruce - Thanks for your reply. What you said is starting to make sense... For a ST pin to recognize input, it has to reach ~4V. For a TTL pin to recognize input, it has to only reach ~2V. Is that correct? So what you are saying is that in order to use a ST pin for serial input, the "signal" needs to be ~4+ Volts. And I am assuming that in most cases this would require a MAX232 to achieve those levels. Correct?
OK, let's just forget about the input for the time being. Can I use a ST pin for TXmit without any problems? Right now, the program transmits (supposed to) the commands to start playing when it receives a trigger. Well, I don't seem to be able to do that either. Any thoughts?
Here's my code:
Code:
INCLUDE "modedefs.bas" 'Needed for serial communication
@ DEVICE HS_OSC ; Hi Speed Osc
ADCON1 = 7 ' Set PortA Pins as I/O pins
CMCON = 7
Trigger var PORTC.6
PlayLED var PORTD.1
TXPin var PORTA.2 'E.1
RXPin var PORTA.3 'E.2
B0 var byte
CR CON 13 ' constant value of a carriage return
'****************************************************************
low playled
'****************************************************************
PAUSE 3000 'allow VMusic2 to initialize
SEROUT txpin, T9600,["VST",CR] 'stop anything that's playing
'****************************************************************
Loop0:
if trigger = 0 then goto loop0 'button is pulled low via 10K resistor
high playled
SEROUT txpin, T9600,["VPF file000.mp3",CR] 'Play a file named "file000.mp3"
PAUSE 2000
SERIN rxpin, T9600, [">"],B0 'Waits for ">" to indicate playing done
low playled
PAUSE 2000
goto loop0
end
Bookmarks