2011-02-12, 07:27:49
(This post was last modified: 2012-12-23, 19:52:09 by Mikael Gustavsson.)
Hi Mikael, Graham here from Digital DIY.
With the feature packed 18F25K22 now fully supported by Microchip, it is becoming the PIC of choice for PICAXE, Amicus and Xino. I have a few of them to test with, although I found there were some issues with the ds30 bootloader.
First thing I noticed - 'Device.INC' has a duplicate pre-compile option:
After correcting that, I entered in the settings for my hardware (an Amicus board with 16Mhz crystal). Here's the relevant settings from 'settings.inc'
The ds30 GUI can not detect the device, and a quick check with 18F25K20 settings suggest the hardware works fine (the GUI picks it up fine). What am I overlooking?
I should have added that I am using MPLAB 8.63
With the feature packed 18F25K22 now fully supported by Microchip, it is becoming the PIC of choice for PICAXE, Amicus and Xino. I have a few of them to test with, although I found there were some issues with the ds30 bootloader.
First thing I noticed - 'Device.INC' has a duplicate pre-compile option:
Code:
ifdef __18F25K22
#include p18F25K22.inc
#define VALID_DEV 1
#define MAX_FLASH 0x8000
#define DEVICEID 83
#define HAS_UART2 1
#define ROWSIZEW 32
endif
Code:
;------------------------------------------------------------------------------
; Device
;------------------------------------------------------------------------------
LIST P=18F25K22; ;xxx
;------------------------------------------------------------------------------
; Includes
;------------------------------------------------------------------------------
#include "devices.inc"
;------------------------------------------------------------------------------
; User preferences
;------------------------------------------------------------------------------
radix DEC
#define DEV_MODE 1 ;xxx delete or comment this line
#define OSCF 64000000 ;xxx oscillator frequency
#define BLTIME 2000 ;xxx data receive timeout [ms]
#define BLINIT 2000 ;xxx hello receive timeout [ms]
#define HELLOTRIES 2 ;xxx number of non hello characters received before branching to the user application
;------------------------------------------------------------------------------
; UART settings
;------------------------------------------------------------------------------
#define BAUDRATE 115200 ;xxx baudrate
#define USE_UART1 1 ;xxx uncomment to use uart1
;#define USE_UART2 1 ;xxx uncomment to use uart2
;#define USE_BRG16 1 ;xxx uncomment to use 16-bit brg
;#define USE_TXENABLE 1 ;xxx uncomment to use a tx enable pin
#ifdef USE_TXENABLE
#define TRISR_TXE TRISC ;xxx tris register containing tx enable
#define LATR_TXE LATC ;xxx port register containing tx enable
#define TRISB_TXE TRISC6 ;xxx tris bit for tx enable
#define LATB_TXE RC6 ;xxx port bit for tx enable
#endif
;------------------------------------------------------------------------------
; CAN settings
;------------------------------------------------------------------------------
;#define USE_CAN ;xxx uncomment to use CAN instead of UART
#define ID_PIC 1 ;xxx node number for this device
#define ID_GUI 0x7ff ;xxx node number of the ds30 Loader gui
;------------------------------------------------------------------------------
; Advanced settings
;------------------------------------------------------------------------------
#define PROT_GOTO 1 ;xxx protect goto at 0x00
#define PROT_BL 1 ;xxx protect bootloader
#define BLPLP 7 ;bootloader placement, pages from end
#define BLSIZEP 7 ;bootloader size [pages], used by bootloader protection
;------------------------------------------------------------------------------
; Configuration bits, these macros can be found at the end of the inc-files located in
; C:\Program Files\Microchip\MPASM Suite\
;
; These can also be set in MPLAB IDE instead, they are found in Configure->Configuration bits...
;------------------------------------------------------------------------------
CONFIG FOSC = HSHP
CONFIG PLLCFG = ON
CONFIG FCMEN = OFF
CONFIG IESO = OFF
CONFIG BOREN = ON
CONFIG WDTEN = OFF
CONFIG WDTPS = 128
CONFIG PBADEN = OFF
CONFIG STVREN = ON
CONFIG LVP = OFF
CONFIG XINST = OFF
CONFIG DEBUG = OFF
I should have added that I am using MPLAB 8.63