Archive for January, 2011


PICKIT 2 update

We were using PICKIT software version 2.60.00 which gave the message “unsupported device”. To use a 25K22 with a PICKIT 2 we need to update the PK2DeviceFile.dat file which is usually in C:\Program Files\Microchip\PICkit 2 v2.

Download it from Microchip, the PK2 page is here

MPLAB update

Older versions of MPLAB will need updating.

Download it from Microchip, the PK2 page is here

How to install the update file:

  1. Close PICKIT software if it’s running.
  2. Simply rename (don’t delete) the old file to something memorable, I always change the file name by putting OLD at the but the choice is yours.
  3. Copy the file into the directory.
  4. Start PICKIT software.
  5. You can now use your PICKIT2 with the 18F25K22

DS30 bootloader

Our 25K20 version of the 64Mhz PLL bootloader HEX was programed into the 25K22. When restarted the PIC refused to run the loader. It will need a new version of the DS30 bootloader creating.

DS30 is opensource and can be downloaded from here

What compilers/languages support the 18F25K22 on a XINO basic for PIC?

AMICUS: Will in a future update we are told (date unknown)
Proton: Probably should (as yet untested by us)
Swordfish: Here’s a post from the SF forum (as yet untested by us)

PICAXE: Yes, the 28×2 that is based on this device has had limited testing.

If you know of any other compilers that do support this PIC that you have tried sucessfully on a XINO basic for PIC please let us know and we’ll add them.

Category : Uncategorized | Blog

Software you will need.

The free Swordfish SE compiler software from here
The free DS30 loader software from here


Adding DS30 as the default programmer to Swordfish means that you can compile and program in one easy step. Configuring this is almost identical to setting it up within the Amicus IDE. If you intend to use the DS30 GUI manually you need not complete these steps, simply use the GUI to locate and program the HEX file that Swordfish creates.

To configure go to the main menu and view. In the drop down click compile and programmer options. A box like this will pop up.

Click install new programmer

Click next

Type in DS30 and click next

Type in ds30loaderconsole.exe and click next

If you want to make a cup of tea click find automatically, if not click find manually and navigate to the folder that DS30 installed to. Below is the default, your will probably be the same

Click next and it’ll now ask for parameters, cut and paste the line from below but remember to change the COM5 to whatever com port you’d like DS30 to use.

-file=$hex-filename$ –device=PIC$target-device$ –port=COM5 –baudrate=115200 –write-program –non-interactive

Make sure that the compile and program is turned on in swordfish (it’s located wierdly in th places  shown in the picture below).  Finally to compile and program hit the two blue arrows to start the process. At this point it’s best to have your finger pressing down the reset on your XINO. The DS30 loader only runs at first powerup.


When this box pops up release the reset button and you should see a flash of text and the box close. This should now have transferred the HEX file to you PIC and should be running it. Thats all there is to it.

Category : Development equipment | Blog

Modifying a Nokia CA-42 to enable you to serially upload compiled hex files to a DS30 boot loaded 18F25K20 on a XINO basic for PIC is relativly easy and very straight forward. You’ll need a soldering iron and some solder (not plumbers the electrical flux variety). This little series of photos shows how to build an “unpluggable” device. There’s nothing to stop you hardwiring the CA-42 Black, Blue and White wires to pins 1, 3 and 4 on the XINO serial pads or using any other method you’d like.

You’ll need just 4 items: (soon to be a kit availble from us)
1 x Nokia CA-42 cable
1 x 4 way right angled “male” header
1 x 4 way right angled “female” header (not pictured, this is soldered to the XINO basic)
1 x small piece of vero and some way to secure the cable from strain.

Picture 1

In this example I’ve used a Dremel type tool to nibble notches out the vero so I can use a small tie wrap to secure the cable. Blue tack is a rapid but not very permanent alternative. Hot glue would be ideal. The choice is yours.







Picture 2

Your cable should look like this, cut the Nokia end (the aysymetrical one on the left of the picture) off to leave the USB connector and about a meter of wire.








Picture 3

Strip off around a centimeter of the black insulation to reveal the inner 5 wires.









Picture 4

Cut off the Green and Orange wires, we dont need them.









Picture 5

Solder on to the vero the right angle header and the Black, Blue and White wires to pins 1, 3 and 4.


That’s all there is to it.







Possible improvements

One user has suggested that the 4.6 volt signalling the cable uses is beyond the limits of the 3.3V PIC. He has used a resistor to limit the current. From our testing we haven’t seen any problems and are lead to believe by sources close to Microchip the 25K20 is 5v tolerant although there seems to be no publisehed evidence of this.

Category : Development equipment | Blog

Features of the XRF

Transmission range on whip antenna of easily 300+ meters L.O.S. (570m in our tests)
Transmission range with external SMA antennas of Km’s (figures yet to be published)
Varaible: baud rate, over the air rate & frequency.
Repeater mode (mirrors data over 2 PANID’s).
Low power consumption 19ma RX, 32ma TX @full power (to be selectable)
Serially (RX/TX) updateable firmware, no CTS/DTR required.
Can be used as CC1110 micro with IAR C compiler software.

Features of the CC1110 as used in the XRF

High-performance RF transceiver based on the market-leading TI CC1101
Excellent receiver selectivity and blocking performance
High sensitivity (–110 dBm at 1.2 kBaud)
Programmable over the air data rate up to 500 kBaud
Programmable output power up to 10 dBm for all supported frequencies
Frequency range: 300 – 348 MHz, 391 – 464 MHz and 782 – 928 MHz
Digital RSSI/LQI support
Low Power
Lowest current consumption (RX: 16.2 mA @ 1.2 kBaud, TX: 15.2 mA @ –6 dBm output power)
High speed, full power consumption (RX:19mA @ 250kBaud, TX:32mA @ +10 dBm output power)
0.3 µA in PM3 (operating mode with the lowest power consumption, only external interrupt wakeup)
0.5 µA in PM2 (operating mode with the second lowest power consumption, timer or external interrupt wakeup)
MCU, Memory, and Peripherals
High performance and low power 8051 microcontroller core.
Powerful DMA functionality
8/16/32 KB in-system programmable flash, and 1/2/4 KB RAM
128-bit AES security coprocessor
7 – 12 bit ADC with up to eight inputs
I2S interface

XRF pinouts for transparent serial mode

01 - +3V3                   20 - Future use
02 - Data Out               19 - Future use
03 - Data IN                18 - Future use
04 - Future use             17 - Future use
05 - Reset                  16 - Future use
06 - Heart Beat             15 - Future use
07 - Future use             14 - Future use
08 - Future use             13 - Future use
09 - Sleep             12 - Future use
10 - GND                    11 - Future use

CC1110 datasheet, webpage & errata

XRF pinouts, physical connections to the TI CC1110 transciever ports

01 - +3V3                   20 - P2_4
02 - P0_3                   19 - P2_3
03 - P0_2                   18 - P2_2
04 - P0_4                   17 - P2_1
05 - Reset                  16 - P2_0
06- P1_7                    15 - P0_7
07- P1_6                    14 - P0_6
08- P1_5                    13 - P0_5
09- P1_4                    12 - P0_0
10 - GND                    11 - P0_1

CC Debugger connections

Antenna Lengths

Calculated antenna lengths.

433 1/4 wave = 164.7mm
433 1/2 wave = 329.4mm
433 full wave = 692.7mm

868 1/4 wave = 82.2mm
868 1/2 wave = 164.3mm
868 full wave = 345.5mm

915 1/4 wave = 77.9mm
915 1/2 wave = 155.9mm
915 full wave = 327.8mm

Useful site for calculation

TI uses slightly longer on CC1110 reference, unknown why. Chipcon/TI primer paper on antenna design with calculations

Configuring your XRF

Attach the XRF to a PC using either the Cisceo FTDI USB interface or something similar. The baud rate by default is 9600

Note [ret] represents a carriage return character (enter key)

To enter command mode:(hyperterm/xctu etc)
Do nothing for at least 1 second
type in +++ (press nothing else)
then wait 1 second
XRF will reply OK, you are now in config mode, the wireless is suspended
General format of commands:
Command without parameter (usually used to query a configuration)

Command with parameter (up to 32 bytes of data)
ATxx [space] dddddd[ret] (versions after and inc. v0.11 the space is optional)

The XRF will reply ERR[ret] for any command that is not recognised.

AT command list

Command  Meaning                           XRFResponse        XRFResponse
                                           without parameter  with Parameter
                                           Actions the        Sets the value
                                           command or reads
                                           the value
AT       Null command                      OK[ret]            OK[ret]
ATAC     Apply Changes                     OK[ret]            N/A
         Returns OK and then
         applies changes to baud           
ATBD     Baud rate                         nnnnn[ret]         OK[ret]
         not set until ATAC command        OK[ret]
         Common baud rates in HEX:
          1200            4b0              Where nnnnn is      Parameter is the
          2400            960              the baud rate       baud rate in HEX
          4800            12c0             in HEX
          9600 (default)  2580
          19200           4b00
          31250 (MIDI)    7a12
          38400           9600
          57600           e100
          115200          1c200
ATCC     Change AT guard character         +[ret]            OK[ret]
         Example change to "///"           /[ret]
ATCH     Radio frequency                   n[ret]            OK[ret]
         Not set until ATCH command        OK[ret]
          1 – 915MHz
          2 – 903MHz                       Where n is the    Parameter is the
          3 – 868MHz                       frequency number  frequency to set
          4 – 433.5MHz                                       to.
          5 – 868.3MHz (default)
          6 – 315MHz
ATDN     Done                              OK[ret]           N/A
         exit AT command mode
ATDR     Radio data rate                   n[ret]            OK[ret]
         Not set until ATCH command        OK[ret]
          1 – 250Kbaud (default)
          2 – 38.4Kbaud                    Where n is the   Parameter is the
          3 – 1.2KBaud                     data rate (0-5)  data rate (0-5)
          4 – 100KBaud
          5 – 500KBaud
ATID     PANID (aka network name)          nnnn[ret]         OK[ret]
         Four hex characters               OK[ret]
         Default – 0000
         Max value FFEF                    Where nnnn is    Parameter is the
         (last 256 PANIds reserved for     the PANID        PANID
         internal use)
ATI2     PANID2 – for repeater function    nnnn[ret]        OK[ret]
         Four hex characters               OK[ret]
         Default – 0000
         Max value FFEF                    Where nnnn is    Parameter is the
         (last 256 PANIds reserved for     the PANID2       PANID2
         internal use)
ATNT     Node type                         n[ret]           OK[ret]
          0 – Serial pass through mode     OK[ret]
          1 – reserved
          2 – Repeater mode                Where n is the   Parameter is the
                                           current mode     mode to set

         NOTE: In repeater mode you cannot use the normal serial. What
               happens instead is that RF data on PANID and PANID2 are
               mirrored in both directions. This is useful for merging
               separate PANID networks or for extending the whole network
               by one node.
ATPC     Reprogram                          OK[ret]        N/A
         Chip will reprogram itself and reset
         Will return ERR if an image has not
         been downloaded into memory
ATPG     Enter program download mode        OK[ret]        N/A
ATPK     Radio packet length (in hex)       nn[ret]        OK[ret]
         Inc. 2 byte PANID, so min. is 3    OK[ret]
         Parameter is 3 to FC (3 to 250 decimal)
         Default is OE (14 - i.e. 12 data bytes)
ATPL     Radio TX power level               n[ret]         OK[ret]
          0  -30dBm                         OK[ret]
          1  -20dBm
          2  -15dBm
          3  -10dBm
          4   -5dBm
          5    0dBm
          6   +5dBm
          7   +7dBm
          8  +10dBm (default)
ATRE     Restore factory defaults           OK[ret]        N/A
         Note this loads the config from the
         default settings, baud rate, radio data
         rate and radio freq will be actioned
         when changes are applied.
ATRO     Packet timeout                     nnnn[ret]      OK[ret]
         The time in milliseconds before    OK[ret]
         a packet is sent if packet is
         not complete (hex)
         Range 1 to FFFF (65535)
         Default is 64 (100 mS)
ATVR     Software revision number           n.n[ret]       OK[ret]
ATWR     Save config changes to flash       OK[ret]        N/A
         The config changes will be preserved
         for the next startup.

Using CCFlashProg to serially program XRF

1. Attach the XRF to a PC using either the Cisceo FTDI USB interface or something similar (eg sparkfun xbee explorer, AXE210), CCFlashProg assumes the XRF baud rate is 9600bps.
2. Start CCFlashProg.exe
3. Select the serial port that XRF is connected to
4. Select the hex file to program to the XRF
5. Press program – if it fails to start try again, the serial timing could be a little different between the PC and XRF
6. After it programmed, press verify – if it fails to start, try again
7. If all is reported OK press commit.
8. XRF will restart with the new firmware
9. (Optional) Using a terminal emulator app (XCTU, Hyperterm etc) issue +++ to the XRF and then using the ATVR command check the new software revision number.

Restoring factory defaults

Short pins 19 and 20 during startup and the XRF will load in factory configuration (not firmware). If you wish to retain this configuration then you need to issue an ATWR command to save the config, otherwise at next power up the previous configuration will be used.
This is useful for recovering from unknown configurations.

Firmware change history

v0.11 – Added ATRO/ATPL/ATPK/ATCC commands
v0.10 – Baud rate command changed to provide even more flexibility in baud rates.
v0.09 – First commercial release.

Category : Uncategorized | Blog