Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Mongoose (robot) & the Swordfish BASIC compiler

Status
Not open for further replies.

blueroomelectronics

Well-Known Member
Swordfish BASIC & Mongoose (robot)

Well thanks to Gramo and his love of BASIC for the PIC looks like another programming option will be available for the upcoming Mongoose kit.
Swordfish BASIC is only for the 18 series PICs and looks great, its demo Swordfish SE is not nearly as crippled as many of the other BASIC compilers (200 bytes of RAM should be plenty for getting a grip on Mongooses 18F2525).
https://www.sfcompiler.co.uk/swordfish/

Swordfish doesn't support MPLAB directly (too bad) but you can add the TinyPIC Bootloader...

**broken link removed**

So you can now program Mongoose in BASIC, C18 & Assembler...
 
Last edited:
hi,
I have been trying out the lite version of Swordfish, it a very nice piece of kit.

To program the 18F452 with hex file that SW generates you can use the programmer in MPLAB. Use the menu 'import' function to load the hex file into the program memory, check with menu 'view' to make sure its there.

Set up the config dialog box settings and then program and verify the PIC.
 
ericgibbs said:
hi,
I have been trying out the lite version of Swordfish, it a very nice piece of kit.

To program the 18F452 with hex file that SW generates you can use the programmer in MPLAB. Use the menu 'import' function to load the hex file into the program memory, check with menu 'view' to make sure its there.

Set up the config dialog box settings and then program and verify the PIC.


Just on configs, Swordfish will produce the required config code aswell, just open the PIC's file, as shown in the attachments, and then scroll right to the bottom - theres a list of config settings.

To change configs at the start of your program, just put;
Code:
Device = 18F452
Clock = 20

Config
   OSC = HS,
   OSCS = OFF,
   PWRT = ON,
   BOR = ON,
   BORV = 25,
   WDT = OFF,
   WDTPS = 128,
   STVR = ON,
   LVP = OFF,
   DEBUG = OFF

Now when you open the .hex in IC-Prog/WINPIC, all the options will be chosen by default (well they already will because they are included in the 18F452 core file, but now you can 'override' the default configs)
 

Attachments

  • sf1.JPG
    sf1.JPG
    59.5 KB · Views: 665
  • sf2.JPG
    sf2.JPG
    96.6 KB · Views: 539
Thanks Gramo, I'm using the 18F2525 but I'm sure the method is the same. I wonder how easy it is to hit the RAM limitation? Doe that include SFRs?
 
hi,
I use a similar method to gramo when using Swordfish with 18F pics.

For 16F pic's I have 'dummy headers' of the CONFIG which I assemble in MPLAB, before I import the HEX file.

As sometimes using the Config dialog box unexpected results happen.

blueroomelect: for ref I use the PICstart+, program option in MPLAB menus.
 
blueroomelectronics said:
I wonder how easy it is to hit the RAM limitation? Doe that include SFRs?

Yes indeedy, but you can make some rather large projects in comparison to 'length' restrictions. There's always a way around floats/memory intensive functions, take my **broken link removed** example. Accurate too 3 decimal places, without floats (not possible to use the FloatToStr function due to memory requirements.)

Swordfish is very optimized though, and will recycle variables if it can.
 
Status
Not open for further replies.

Latest threads

Back
Top