SX48 Module - First Program
![Bill Chennault](https://forums.parallax.com/uploads/userpics/820/n25YAQT2TKN7D.jpg)
All--
I finally got around to using RobotWorkshop's neat SX48 module. I am doing something wrong, probably with the DEVICE and/or FREQ statements. Here is what I tried . . .
Device SX48, TURBO
FREQ·· 20_000_000
Led Pin RA.0
Program Start
Start:
· High Led
· Pause 500
· Low Led
· Pause 500
· Goto Start
The program compiled successfully. I then performed a RUN operation from the menu and received . . .
Obsolete Keyword <TURBO> for this device
No OXCxxx directive - using default OSCRC
The module has a 20MHz resonator.
The same circuitry works (the Led blinks) when I replace the SX48 module with a PBasic-programmed BS2.
I am using IDE Ver. 3.2.9h Beta.
Is it possible to tell me what I am doing wrong given the information above?
Thanks!
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
I finally got around to using RobotWorkshop's neat SX48 module. I am doing something wrong, probably with the DEVICE and/or FREQ statements. Here is what I tried . . .
Device SX48, TURBO
FREQ·· 20_000_000
Led Pin RA.0
Program Start
Start:
· High Led
· Pause 500
· Low Led
· Pause 500
· Goto Start
The program compiled successfully. I then performed a RUN operation from the menu and received . . .
Obsolete Keyword <TURBO> for this device
No OXCxxx directive - using default OSCRC
The module has a 20MHz resonator.
The same circuitry works (the Led blinks) when I replace the SX48 module with a PBasic-programmed BS2.
I am using IDE Ver. 3.2.9h Beta.
Is it possible to tell me what I am doing wrong given the information above?
Thanks!
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
Comments
Try "DEVICE SX48,OSCHS1".
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There is a fine line between arrogance and confidence. Make sure you don't cross it...
·
Thank you, but I am still doing something wrong. Here is the code with your correction . . .
' BLINK1.SXB
DEVICE·SX48,OSCH1
FREQ·20_000_000
Led·Pin·RA.0
Program Start
Start:
·High Led
·Pause 500
·Low Led
·Pause 500
·Goto Start
Now, I get the additional error, Line4, Error14, Pass 1: Bad Argument <OSCH1>
If I can get it to work once . . . [noparse]:)[/noparse]
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
You missed an S
regards peter
Many thanks.
Now it compiles without error and downloads successfully. But, still no blink. I am going to swap out SX48 modules.
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
I swapped out SX48 modules. The postive side of the led is connected to RA.0; physical pin 5 on the SX48 module. The negative side of the led is connected to a 470 ohm resistor which is connected to VSS. I am using the USB-Key.
Way weird. Now, it compiles/assembles and downloads successfully, but no blink.
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
Thank you for all your help! Physical pin 5 of RobotWorkshop's most-excellent replacement for the BS2p40 is RB.0, not RA.0 as I believed from reading the draft of Practical SX/B. I do not know if I should have been able to figure this out from the draft, which states to me (page 26 code listing) that the Led should be connected to RA.0. I DID figure it out by looking at RobotWorkshop's schematic to discover that the RA nibble is not brought out on the SX48 module to the user. Physical pin 5 of the SX48 module is RB.0.
Of course, JonnyMac had no way of knowing I was going to use RobotWorkshop's SX48 module and RobotWorkshop had no way of knowing I was going to use JonnyMac's book. I suppose that is what experience is all about . . . they have it and I don't.
Thank you for not giving up on me! I should have the ex-Ugly Buster up and running on the SX48 module via remote control implemented by Bluetooth back to VB talking to my Logitech game pad in half an hour or so. [noparse]:)[/noparse] Actually, it all works now. I just need do some brain surgery and write a little code for the GUI I already have up and running.
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
Glad to hear that the modules are working out for you! If you aren't using the EEPROM you can pull it out of the DIP socket to get at RA.0 and RA.1 pins. The RA.2 and RA.3 are set aside for a serial port and could also be used if the MAX232 is removed or it is left of during construction. The rest of the I/O ports RB, RC, RD, and RE are all brought out to the edges of the module. They are marked but the writing is small as there wasn't much room left on the board. At any rate it sounds like you've made excellent progress on your robot. Nice that the schematic proved to be a good reference.
Robert
That professionally drawn schematic is a life-saver for sure! When even an electronics illiterate like me can make sense of it you know it has to be good. I thank you.
Ugly Buster was driven by five Stamps, a Master (BS2p40)·and four Slaves (BS2). Each Slave served a dedicated function and either reported a single bit of information to the Master or received a five bit command from the Master. Obviously, Ugly Buster was hardware heavy and therefore software lite relative to his intended purpose as my learning device.
Long live Ugly Buster.
I removed all the logic and replaced it with a single one of your SX48 modules. It is my belief that a sinlge SX48 module will easily take the place of all five Stamps, plus handle my eb501 Bluetooth remote control back to Windows and a VB-based GUI controlled by a game pad. If this does not prove to be the case, I will add SX48 modules as fast, more-intelligent Slaves, which I would like to do anyway to experiment with a more advanced version of my bit-signalling scheme. (Handshaking would be real nice as I could then handle a bit stream instead of a single n-size bit instruction as in Ugly Buster.)
And, yes, I am definitely having fun!
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.