Swordfish board for Arduino - work in progress

Post here to let others know of a project you're working on.

Moderators: Chuckt, Garth, bitfogav

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Swordfish board for Arduino - work in progress

Post by bitfogav » Sun Mar 09, 2014 9:47 pm

Hi guys,

I've been working on a Swordfish board with an Arduino footprint, so it should work with Arduino/Firewing shields and DigiPixel :)
It is still a work in progress so it might take a few versions to get it right.

I'm thinking of using a Swordfish version bootloader, which will make it easier to programme the board via HID usb and using Microchips HID bootloader software..
Attachments
SF_Arduino_3D.jpg
Swordfish board
SF_Arduino_3D.jpg (43.6 KiB) Viewed 26956 times
If you don't know what Voltage your country is using, you shouldn't be doing electronics ;-)

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Swordfish board for Arduino - work in progress

Post by brad » Wed Mar 12, 2014 10:40 pm

I should have logged in and seen this earlier!

This is fantastic Gav! I want one! Do you think it would be worth while me getting a quote from my manufacturer to get maybe 50 or 100 of these things made? Swordfish is an amazing IDE. I have been using it for my power meter project and man it is nice, it flows so beautifully and I know I said that I like Arduino, but I guess that's because I got used to it. Swordfish is the best. But it's kind of bitter sweet because I know that I am using a piece of software that is 'almost' dead.

What Microcontroller have you got planned for this board?

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Re: Swordfish board for Arduino - work in progress

Post by bitfogav » Thu Mar 13, 2014 4:01 am

Yes indeed I have had a few people already interested in getting one! :D And I think Swordfish needs an easy to use development board. I don't think Arduino is going anywhere for awhile with the amount of add-on boards on the market so this sort of thing with the Arduino footprint should be a great tool!..

Thank you for the offer of getting a quote from your manufacturer, that maybe something we could look into, dependsing what direction this board ends up in..

The Microcontroller I looked at using was the 18F46J50, it's a 3.3v device with USB and it has PPS (Peripheral Pin Select)
which would make arranging the board pins easier, the only problem with this is that not all pins are 5v tolerant.
So I've decided for this first prototype to use a 5v Microcontroller and my favourite 18F4550 :D I may even make the board optional for a 3.3v or 5v device and include some solder tags which would allow the user to select which Microcontroller they wanted to use?.

Well the board design has been sent to be manufactured, so I shall be receiving them soon. the next part will be the best part, the software :wink:
If you don't know what Voltage your country is using, you shouldn't be doing electronics ;-)

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Swordfish board for Arduino - work in progress

Post by brad » Thu Mar 13, 2014 10:27 pm

Nice work Gav, keep me updated on not only the PCB but the software :)

I know on Arduino's (or some of them at least) there are jumpers on the board that allow you to select between 3.3v and 5v. But I have to admit, I am a little bit 'old school' and much prefer to use 5v devices. USB is 5v and there are loads of TTL chips that I like to interface to my projects, so 5v is nice and easy. Having said that. I am pretty sure the electronics community will probably shift over to 3.3v / 3.6v eventually...

By the way - the 18f4550 is one of my favourite chip too!

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Re: Swordfish board for Arduino - work in progress

Post by bitfogav » Sun Mar 30, 2014 11:42 pm

Well it's been a few weeks and I thought I would share what I have so far with this prototype board..
The pcb board arrived last week from iTeadstudio.com, and I couldn't wait to get one made up and get on with some programming and testing!. :)

Some example images of the board:
PCBsmall.jpg
bare pcb
PCBsmall.jpg (82.17 KiB) Viewed 26888 times
MadepcbSmall.jpg
completed board
MadepcbSmall.jpg (81.19 KiB) Viewed 26888 times
ledsSmall.jpg
status leds
ledsSmall.jpg (77.46 KiB) Viewed 26888 times
I have a working Swordfish bootloader firmware on the board, which makes it so easy to upload new programmes to the board via USB.

The board contains several leds to indicate if the board is in Bootloader mode and the good old arduino D13 led :wink: and a button.
If you don't know what Voltage your country is using, you shouldn't be doing electronics ;-)

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Re: Swordfish board for Arduino - work in progress

Post by bitfogav » Sun Mar 30, 2014 11:42 pm

Heres an example of the first led flash programme running on the board with the bootloader uploaded.

Code: Select all

// bitfogav sf board hardware
Device = 18F4550
Clock = 48

Config
    FOSC = HSPLL_HS,         ' External 20MHz xtal
    PLLDIV = 5,
    CPUDIV = OSC1_PLL2,      ' 48MHz cpu clock
    USBDIV = 2,              ' 48MHz usb clock
    FCMEN = OFF,
    IESO = OFF,
    PWRT = ON,
    BOR = OFF,
    BORV = 2,
    VREGEN = ON,
    WDT = OFF,
    MCLRE = ON

' include module for sf board...    
Include "SFBoard.bas"

' build for bootloader operation
#option org_reset = $001000

' note: include system.bas first before any other files
' this is VERY important if you're using a bootloader (requires system.bas V1.4 or later)
' be sure to set any system.bas WDT options prior to including the file
Include "system.bas"

' init_pic() - setup IO pins...
Sub init_pic()
    TRISA = %00000000       ' all outputs
    TRISB = %00000000       ' all outputs
    TRISC = %00110100       ' D+ and D- are inputs
    TRISD = %00111100       ' leds and PB_SWITCH input
  
    ADCON1 = %00001111      ' all digital (disable A/D on all pins)
    CMCON = %00000000       ' disable comparators
    CVRCON = $00            ' and turn off reference

    PORTA = $00              ' PORTA outputs Low
    PORTB = $00              ' PORTB outputs Low
    PORTC = $00              ' PORTC outputs Low
    PORTD = $00
End Sub


' main entry point
init_pic()

' main program loop...
While (true)    
    Toggle(D13)
    DelayMS(500)
End While


And I have also put together a DigiPixel swordfish library and I have DigiPixel running on this prototype board :)
digipixelSmall4.jpg
digipixelSmall4.jpg (78.37 KiB) Viewed 26888 times
If you don't know what Voltage your country is using, you shouldn't be doing electronics ;-)

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Swordfish board for Arduino - work in progress

Post by brad » Thu Apr 03, 2014 8:50 pm

Sorry to be late back here Gav.

But now that I'm back, this is all looking good!

I'm just trying to get my head around the boot loader. Do you load the pic with the boot loader via a pickit2 (or similar) and then what software do you use to upload hex files to the device?

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Re: Swordfish board for Arduino - work in progress

Post by bitfogav » Fri Apr 04, 2014 2:47 am

brad wrote:I'm just trying to get my head around the boot loader. Do you load the pic with the boot loader via a pickit2 (or similar) and then what software do you use to upload hex files to the device?
Yes you load the bootloader onto the chip via the icsp (pickit2), connect up a usb to the micro usb connector and then put the board into "programme mode" by resetting the board using the on board pgm button & reset button.
You can now use microchips HID bootloader software to load your hex file onto the board.

So basically you could supply the board with the bootloader installed and the user doesn't need a pickit2 to programme the device. :) I hope that makes a bit more sense?.

The microchip software looks like this:
microhid1.jpg
microhid1.jpg (15.3 KiB) Viewed 26862 times
If you don't know what Voltage your country is using, you shouldn't be doing electronics ;-)

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Swordfish board for Arduino - work in progress

Post by brad » Sat Apr 05, 2014 10:25 am

I like it! Im going to have to test this thing out. Any chance you could post some links to downloads?

Also is there any other way of putting it in boot loader mode or do you have to press the buttons? I.e. could it detect a USB connection upon the microcontroller starting up?

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Re: Swordfish board for Arduino - work in progress

Post by bitfogav » Sat Apr 05, 2014 8:12 pm

brad wrote:Any chance you could post some links to downloads?
The best thing to do is download Swordfish USB Library v1.4.2 that Jerry has done here. It includes microchips HID App (inc C# source), and you can also find Jerry's examples for USB, And ported Swordfish bootloader within the download file..

Note: there are a few bugs in the usb version v1.4.2 that can be easily fixed here.
brad wrote:Also is there any other way of putting it in boot loader mode or do you have to press the buttons? I.e. could it detect a USB connection upon the microcontroller starting up?
Not that I know of?, maybe you could modify the bootloader to wait for a period of time for any USB packets. If not, the bootloader times out and runs the user code?.
Or Have the bootloader check for reset, more info here.


It would be a lot easier to use a RS232 chip, as I'm sure you know like the PicNDuino boards?.
If you don't know what Voltage your country is using, you shouldn't be doing electronics ;-)

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Swordfish board for Arduino - work in progress

Post by brad » Mon Apr 07, 2014 8:34 pm

Thanks again Gav!

I'll add it to my ever increasing list of projects to-do!

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Re: Swordfish board for Arduino - work in progress

Post by bitfogav » Tue Apr 08, 2014 3:16 am

brad wrote:I'll add it to my ever increasing list of projects to-do!
That must be a BIG list by now!! haha.... :lol:
If you don't know what Voltage your country is using, you shouldn't be doing electronics ;-)

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Swordfish board for Arduino - work in progress

Post by brad » Wed Apr 09, 2014 6:04 am

Yes, yes it is...

In fact, I just received an order of tiny little OLED displays from buy display.com (they are so cheap!) and I also bought a couple of touch screens too. I really have no project to use them in but it's on the list of to-dos as well!

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Re: Swordfish board for Arduino - work in progress

Post by bitfogav » Thu Apr 10, 2014 2:49 am

brad wrote:In fact, I just received an order of tiny little OLED displays from buy display.com (they are so cheap!) and I also bought a couple of touch screens too. I really have no project to use them in but it's on the list of to-dos as well!
I do the same Brad, I see something that looks great and I buy it!. then when it comes it gets put into my box of things to do!! :lol:
brad wrote:Also is there any other way of putting it in boot loader mode or do you have to press the buttons? I.e. could it detect a USB connection upon the microcontroller starting up?
I just wanted to add a bit more info on your question above Brad, this is a quote that I have read from DD about detecting a USB connection.
If you're self-powered, you should connect the +5V from the USB connector to an input pin so you can monitor when the USB cable gets plugged/unplugged from the host. I usually use a simple voltage divider (for protection), plus it pulls the pin low when you're not connected so it doesn't float.
So if you use the USB connection, you could detect it and run bootloader mode?, this sounds like a good idea and I might have to test this out! :)
If you don't know what Voltage your country is using, you shouldn't be doing electronics ;-)

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Swordfish board for Arduino - work in progress

Post by brad » Thu Apr 10, 2014 10:04 pm

Thanks for the update Gav.

I'm just wondering though - isn't the +5V from the USB port just shorted straight to the +5V of the onboard regulator. If this is the case, how would the circuit know that it is the USB port providing power or something else?

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Who is online

Users browsing this forum: No registered users and 7 guests