My 1st post on this excellent forum So the short and sweet question is has anyone successfully interfaced the Parallax SoundPal to the Basic Atom Pro (BAP)?
I have a BAP on a breadboard configured pretty much the same way as the Bot Board II (BB2). I have a 5v power supply and a direct serial interface with COM1 on my PC. 1st I loaded the Traffic Light test program from the BAP Syntax Manual using 3 coloured (yes I’m English) LED. The LEDs are on P0, P1 and P2. This worked fine, so I believe the BAP and serial interface are working OK.
I then successfully interfaced my Parallax Ping to P4 and loaded the sample program by Jim Frye from this Forum. As I have few options for displaying any output results I have used my 3 LED to display a binary value indicating the value of WDIST as it goes around the loop.
This removed the need to run in Debug Mode and use DEBUG statements, which didn’t seem to work for me, it kept timeing out.
BTW I have 30 years experience with software (From firmware on Intel 8086 to C# on a PC), but only a year with a CH3-R. Hector works fine, but he needs some eyes so I can make him automonous and some sound effects. I also have some electronics experience as a hobby when I was a teanager. When I didn’t have internet access!
I am now trying to interface a Parallax SoundPAL to my BAP breadboard. The Parallax site isn’t much help because they have a vested interest in their Basic Stamp processor and it seems a little mean to post questions about making it work with a BAP. I have translated the Parallax SoundPAL Basic Stamp sample code to Basic Atom. BUT it does not work, not a squeak.
baud CON NO9600 ' Normal, Open Collector, 9600 baud
reset CON NO1200 ' Normal, Open Collector, 1200 baud
Pause 10
Gosub DoReset
' The "=" loads the following zero terminated sequence into its RAM
' and the "!" executes the loaded sequence.
' The C_1 etc are constants (not shown) defining various notes (pitch) or the duration (e.g. half).
SEROUT P3, baud, "=", C_1, D_1, E_1, F_1, G_1, A_1, B_1, half+C_2, 0, "!"]
End
DORESET:
REPEAT UNTIL P3 ' Wait until SoundPAL has powered up
SEROUT P3, reset,[0] ' Funge to send a 7.5 ms low pulse
RETURN
I have not checked the [0] sent at 1200 baud (NO1200) results in a 7.5 ms low pulse, but how critical can the duration be?! 9 low bits at 1200 baud. How do they get 9 low bits with 8-bits data and no parity? I’m not sure, but it probably has something to do with those start/stop bits?!
I know it comes out of the DoReset loop using my LEDs to indicate progress. I don’t have an ocilloscope to check the output on P3. I was about to investigate if the quoted string “=” is zero terminated on the Basic Atom Pro, but not on the Basic Stamp. There is nothing in the manual that indicates that this is the case. The SoundPAL documentation is quite adament that the output to the SoundPAL should be open collector. The SEROUT should be positive logic, any baud between 9600 and 19200 (?), 8-bits and no parity. I’ve even tried IO9600 i.e. inverted logic, but that made no difference. It explains that the SEROUT is used in DoRest in place of PULSOUT because the PULSOUT leave the output pin in an output state, while the SEROUT is configured open collector and a ‘slow’ zero pulse is output.
Any thoughts/suggestions much appreciated,
JackRabbit
PS I got the BAP, Ping and SoundPAL via Active Robots in the UK.