![]() |
PIC18F85J50 [solved] - Printable Version +- ds30 Loader free edition forums (https://picbootloader.com/forum) +-- Forum: Support (https://picbootloader.com/forum/forumdisplay.php?fid=3) +--- Forum: 8-bit firmwares (https://picbootloader.com/forum/forumdisplay.php?fid=7) +--- Thread: PIC18F85J50 [solved] (/showthread.php?tid=518) |
PIC18F85J50 [solved] - raye - 2012-09-19 Hi All, This product looks just the thing BUT i cannot get it to work ![]() DS30 version 1.5.3 (engine 2.2.7) with all the check boxes in advanced unchecked and all other settings at default. My PIC application osc config with 4mhz crystal PLLDIV = 1 ;Divide by 1 (4 MHz oscillator input) CPUDIV = OSC4_PLL6 ;System clock divide 6 FOSC = HSPLL ;HS oscillator, PLL enabled My app is compiled with pic basic pro 2.6 and DEFINE LOADER_USED 1 at the top of the code. My serial comms on the app works OK so no hardware problems there. I have made no changes to user_code.inc or any other file. I build the bootloader .hex in MPLAB 8.86 and the file builds OK Here is my DS30 settings.inc ;------------------------------------------------------------------------------ ; Device ;------------------------------------------------------------------------------ processor 18F85J50 ;xxx ;------------------------------------------------------------------------------ ; Includes ;------------------------------------------------------------------------------ #include "devices.inc" ;------------------------------------------------------------------------------ ; User preferences ;------------------------------------------------------------------------------ radix DEC #define OSCF 8000000 ;xxx oscillator frequency (including pll) #define BLINIT 2000 ;xxx hello receive timeout [ms] #define HELLOTRIES 2 ;xxx number of non hello characters received before branching to the user application #define BLTIME 2000 ;xxx data receive timeout [ms] ;------------------------------------------------------------------------------ ; UART settings ;------------------------------------------------------------------------------ #define USE_UART1 1 ;xxx uncomment to use uart1 ;#define USE_UART2 1 ;xxx uncomment to use uart2 #define BAUDRATE 19200 ;xxx baudrate ;#define USE_ABAUD 1 ;xxx uncomment to use auto baud rate detection, READ ERRATA FIRST ;#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 TXE_DELAY 10 ;xxx time in us to wait before transmitting after pulling the tx enable pin high #define TRISR_TXE TRISD ;xxx tris register containing tx enable #define LATR_TXE LATD ;xxx port register containing tx enable #define TRISB_TXE TRISD0 ;xxx tris bit for tx enable #define LATB_TXE RD0 ;xxx port bit for tx enable endif ;------------------------------------------------------------------------------ ; Advanced settings ;------------------------------------------------------------------------------ ;#define KICK_WD 1 ;xxx uncomment to kick the wd in the rx loop, only enable if the watchdog is enabled #define PROT_GOTO 1 ;xxx protect goto at 0x00 #define PROT_BL 1 ;xxx protect bootloader #define WRITE_VER 1 ;do flash write verification #define EWRITE_VER 1 ;do eeprom write verification ifdef IS_PIC18F #define BLPLP 9 ;bootloader placement, pages from end #define BLSIZEP 9 ;bootloader size [pages], used by bootloader protection endif ifdef IS_PIC18FJ #define BLPLP 2 ;bootloader placement, pages from end #define BLSIZEP 1 ;bootloader size [pages], used by bootloader protection endif ;------------------------------------------------------------------------------ ; 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... ;------------------------------------------------------------------------------ ; xxx CONFIG STVREN = ON ;Reset on stack overflow/underflow disabled CONFIG PLLDIV = 1 ;Divide by 1 (4 MHz oscillator input) CONFIG XINST = OFF ;Instruction set extension and Indexed Addressing mode disabled (Legacy mode) CONFIG WDTEN = Off ;WDT disabled (control is placed on SWDTEN bit) CONFIG CP0 = Off ;Program memory is not code-protected CONFIG FCMEN = ON ;Fail-Safe Clock Monitor disabled CONFIG CPUDIV = OSC4_PLL6 ;No CPU System clock divide CONFIG FOSC = HSPLL ;HS oscillator, PLL enabled and under software control CONFIG IESO = ON ;Two-Speed Start-up disabled CONFIG WDTPS = 512 ;1:128 CONFIG Wait = Off ;Wait states for operations on external memory bus disabled CONFIG BW = 8 ;8-bit external bus mode CONFIG EASHFT = Off ;Address shifting disabled, address on external bus reflects the PC value CONFIG MODE = MM ;Microcontroller mode - External bus disabled CONFIG MSSPMSK = MSK7 ;7 Bit address masking CONFIG PMPMX = ALTERNATE ;MP port pins not connected to EMB CONFIG ECCPMX = DEFAULT ;ECCP1 outputs (P1B/P1C) are multiplexed with RE6 and RE5 CONFIG CCP2MX = DEFAULT ;CCP2 is multiplexed with RC1 ;------------------------------------------------------------------------------ ; ds30 Loader commercial version ;------------------------------------------------------------------------------ ;-Supports read of flash and EEPROM ;-Supports software UART ;-Supports software CAN ;-Available with encryption ;-Read more at www.ds30loader.com ;------------------------------------------------------------------------------ ; End of file ;------------------------------------------------------------------------------ any ideas ![]() Thanks Ray RE: PIC18F85J50 - Mikael Gustavsson - 2012-09-19 Hi, It looks good as far as I can see. The oscillator config seems fine and uart1 pins are digital only. The baudrate is ok with that osillator speed. The solution from the datasheet? Quote:The PLL will not be available until the PLLEN bit in the OSCTUNE register is set. RE: PIC18F85J50 - raye - 2012-09-21 Hi Mikael, Many thanks for that it works great ![]() Cheers Ray RE: PIC18F85J50 - Mikael Gustavsson - 2012-09-21 Great! Thanks for the update. |