First program Propeller/Spin Stamp/Pulsout
Rob v.d. berg
Posts: 86
Hello,
I will start with the propeller software (Spin) and have the Spin Stamp this week received. The first small program·i have made is this:
CON
··· _clkmode = xtal1 + pll16x
··· _xinfreq = 5_000_000
····················
OBJ
··· BS2 : "BS2_Functions"··· ' Create BS2 Object
PUB Start
··· BS2.start (31,30)······· ' Initialize BS2 Object timing, Rx and Tx pins for DEBUG
··· repeat
····· BS2.PULSOUT(4,500) ' should give 500*2usec ~ 1000usec
This program give no pulsout, only when I remove the two line
'· _clkmode = xtal1 + pll16x
'· _xinfreq = 5_000_000
Without the two lines i get a puls about 880usec!, is this related to the clockcycle? The Spin has 10MHz as external clock?. I have two questions
- what is the correct syntacs for this program
- why is the pulstime not as·expected (~1000usec)
thanks in advance.
Regards,
Rob.
·
I will start with the propeller software (Spin) and have the Spin Stamp this week received. The first small program·i have made is this:
CON
··· _clkmode = xtal1 + pll16x
··· _xinfreq = 5_000_000
····················
OBJ
··· BS2 : "BS2_Functions"··· ' Create BS2 Object
PUB Start
··· BS2.start (31,30)······· ' Initialize BS2 Object timing, Rx and Tx pins for DEBUG
··· repeat
····· BS2.PULSOUT(4,500) ' should give 500*2usec ~ 1000usec
This program give no pulsout, only when I remove the two line
'· _clkmode = xtal1 + pll16x
'· _xinfreq = 5_000_000
Without the two lines i get a puls about 880usec!, is this related to the clockcycle? The Spin has 10MHz as external clock?. I have two questions
- what is the correct syntacs for this program
- why is the pulstime not as·expected (~1000usec)
thanks in advance.
Regards,
Rob.
·
Comments
Repeat
·· BS2.Pulsout(4,500)
·· BS2.Pause(20)
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
SelmaWare Solutions - StampPlot GUI for controllers, XBee and Propeller Application Boards
Southern Illinois University Carbondale, Electronic Systems Technologies
_clkmode = xtal1 + pll8x
_xinfreq = 10_000_000
Most of the examples of spin code floating around are set up for the 5MHz crystal, so make sure to check the CON block anytime you run sample or demo code on a spin stamp. It's easy to forget - I still do it all the time myself!
Mike
The Trick was the·CON block, now·the timing·is OK. The pauze time is about 57usec, cyclus·freq of 17,5KHz
Rob.
CON
· _clkmode = xtal1 + pll8x
· _xinfreq = 10_000_000
····················
OBJ
··· BS2 : "BS2_Functions"··· ' Create BS2 Object
PUB Start
····· BS2.start (31,30)······· ' Initialize BS2 Object timing, Rx and Tx pins for DEBUG
··· repeat
····· BS2.PULSOUT(4,500)·· ' 1 msec