PDA

View Full Version : Propeller servo board 28830 - help wanted



Giftdoktorn
- 25th December 2012, 17:58
Hi
I am a new in this area. I have a Propeller servo controller 28830, a PICkit 2 with 16F690 PIC processor and trying to make a program to control a number of servos in a hobby project. The program is written in PICBasic (micro Engineering Labs) in MPLAB IDE. I have this far managed to successfully control the processors output pins and writing to a serial LCD. But when I am trying to write to the servo controller nothing happens.

In the servo controller manual the example is written in BS2. The program sequence for BS2 looks like this:
ch VAR Byte
pw VAR Word
ra VAR Byte

Sdat CON 15
baud CON 396
ra = 7
ch = 11

Do
pw = 1100
SEROUT Sdat, baud+dollarsign8000, ("!SC", ch, ra, pw.lowbyte, pw.highbyte, CR) () = straight parantesis
pause 1000
etc

I have in PIC basic written
Symbol TrisC = dollarsign87 (I am lacking the dollarsign on the key board)
Symbol PortC = 7
Poke TrisC, 0

Symbol ch = B2
Symbol pw = B4
Symbol ra = B3

Main:
loop
pw = 1000
ra = 62
ch = 15 ( the servo is correctly plugged in at P15 on the board)
Serout 7, T2400, ("!SC", ch, ra, pw, 13)
pause 1000
etc

When is my mistake? Can anyone help?

Best regards

mackrackit
- 26th December 2012, 06:09
To start with.
What do all of your "Symbol"s link back to?

Have you tried the BS2 code? And you could try Shift+4 ;-)