Firewing for PIC18 is based around a powerful Microchip 8 bit 18F25K22 microcontroller that can can be clocked at up to 64MHz. It has an easy to use USB interface, enabling you to both program your board and send and receive serial data to and from your PC. The board can be powered from the USB port or by an external supply, providing both 3.3v and 5v supplies for any connected shields or devices. In addition to standard Firewing shields, the board is pin compatible with Arduino UNO. This gives Swordfish access to a multitude of hardware options!

The Firewing board silkscreen has pins marked like the Arduino, with A0...A5 denoting analog or digital IO pins and D0...D13 denoting digital IO pins. You can access these pins directly using standard syntax like PORTB.2, PORTA.0 etc - This diagram shows you the mappings. However, it's usually much easier to use DO, A3 etc directly, as shown on the board.

The Firewing module allows you to do this by aliasing the PIC style pin notation to the one used by Arduino. In addition, the module provides routines to access ADC and PWM. For example, the following shows how to access the Pwm pins:

' device and clock...
Device  = 18F25K22
Clock   = 64

' import firewing module...
Include "Firewing.bas"

' open Pwm on D5, set LED to low brightness... 
PwmWrite(D5, 50) 

' open Pwn of D6, set to high brightness... 
PwmWrite(D6, 200)

Accessing A0...A5 for Adc is really easy. For example:

' device and clock...
Device  = 18F25K22
Clock   = 64

' import modules...
Include "usart.bas"
Include "convert.bas"
Include "Firewing.bas"

' read a Adc value connected to A0 every one
' second and output the result...
Dim Value As Word
While true
   Value = AdcRead(A0)
   USART.Write("Value = ", DecToStr(Value), 13, 10)
End While

Note that the Firewing USART should be set for 38400 baud operation. To use the Firewing module, download from here:

unzip and then place in your "UserLibrary" folder.


Find the FirewingLoader info here