Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
18F4620 [abandoned]
#1
Rainbow 
Hi

I am having a problem when trying to get the DS30 Loader to communicated with a Pic 18F4620, I know that my RS232 comms is working as I have programmed other 16F devices.
Pic used 18F4620-E/P , 20 Mhz Crystal, Baud rate 115200, WDT Off, Low Power Disabled.

Initializing Download
searching for Bl............Time Out

I am pressing the reset switch connected to MCLR but it shows a time out.
I have gone into MPLAB IDE and set the configuration bits then exported the hex file out and used my programmer to load this into my Pic but when I use the DS30 loader to communicate with the Pic to load my hex file in to it I get the above mentioned problem.

I am using the latest version of DS30 & Gui loaded from the internet about a week ago.

Could someone Please help me and show me where I am going wrong ?

Regards

Craig
Reply
#2
Can Somebody PLEASE help me, There must be someone out there who knows how to sort this problem out ????
Reply
#3
Please supply us with your
* settings.inc.
* firmware version
* gui version

Reply
#4
(2011-02-23, 20:31:16)Mikael Gustafsson Wrote: Please supply us with your
* settings.inc.
* firmware version
* gui version -

Hi Mikael
The version I Downloaded is as below:
Thanks for the Help so far.
What I did is to open the Firmware PIC18F file which opens in the MPLAB IDE and then change the Config and Device settings then save, Build ALL and then export the hex file out to be programmed with my Serial (P8076) Velleman Programmer.

Kind Regards

Craig

Windows installation ds30_loader_110115.exe (2MB)
Firmware PIC16F 1.0.0
Firmware PIC18F 2.0.4
Firmware PIC18FJ 1.0.4
Firmware PIC24F 1.0.0
Firmware PIC24FJ 1.1.1
Firmware PIC24H 1.1.0
Firmware dsPIC30F 3.0.0
Firmware dsPIC33F 1.1.0
ds30 Loader 1.5.0
ds30 Loader GUI 1.3.14
ds30 Loader console 1.0.1

;------------------------------------------------------------------------------
;
; Title: ds30 Loader for PIC18F
;
; File description: user settings and configuration bits
;
; Copyright: Copyright © 09-11, Mikael Gustafsson
;
; Webpage: http://mrmackey.no-ip.org/elektronik/ds30loader/
;
; History: 2.0.4 New setting: 16-bit brg
; 2.0.3 Renamed fosc to oscf
; 2.0.2 New setting: NODENR
; New setting: NODENR_BL
; New setting: PROT_GOTO
; New setting: PROT_BL
; 2.0.1 New setting: HELLORETRIES
; 2.0.0 CAN support
; 1.0.2 -
; 1.0.1 -
; 1.0.0 Added BLINIT
; 0.9.2 Added tx enable support
; 0.9.1 -
; 0.9.0 first version of this file
;
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
; This file is part of ds30 Loader.
;
; ds30 Loader is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation.
;
; ds30 Loader is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with ds30 Loader. If not, see <http://www.gnu.org/licenses/>.
;------------------------------------------------------------------------------


;------------------------------------------------------------------------------
; Device
;------------------------------------------------------------------------------
LIST P=18F4620; ;xxx


;------------------------------------------------------------------------------
; Includes
;------------------------------------------------------------------------------
#include "devices.inc"


;------------------------------------------------------------------------------
; User preferences
;------------------------------------------------------------------------------
radix DEC

#define DEV_MODE 1 ;xxx delete or comment this line
#define OSCF 20000000 ;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 OSC = INTIO2 ;internal oscillator
;config FSCM = OFF ;failsafe clock monitor
;config IESO = OFF ;internal external switchover mode
;config PWRT = OFF ;power-up timer
;config BOR = OFF ;brown-out reset
;config BORV = 27 ;brown-out reset value
;config WDT = OFF ;watchdog timer
;config WDTPS = 1 ;1:1 WDT prescalar
;config MCLRE = ON ;MCLR
;config STVR = ON ;stack overflow reset
;config LVP = OFF ;low voltage programming
;config DEBUG = OFF ;debug
;config CP0 = OFF ;
;config CP1 = OFF ;
;config CPB = OFF ;
;config CPD = OFF ;
;config WRT0 = OFF ;
;config WRT1 = OFF ;
;config WRTB = OFF ;
;config WRTC = OFF ;
;config WRTD = OFF ;
;config EBTR0 = OFF ;
;config EBTR1 = OFF ;
;config EBTRB = OFF ;

;__CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC3_PLL4_1L & _USBDIV_2_1L
;__CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H & _FCMEM_OFF_1H & _IESO_OFF_1H
;__CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_OFF_2L ; _VREGEN_OFF_2L
;__CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_1_2H
;__CONFIG _CONFIG3H, _MCLRE_ON_3H & _PBADEN_OFF_3H & _CCP2MX_OFF_3H
;__CONFIG _CONFIG4L, _DEBUG_OFF_4L & _LVP_OFF_4L & _STVREN_OFF_4L & _XINST_OFF_4L
;__CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L
;__CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
;__CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L
;__CONFIG _CONFIG6H, _WRTB_OFF_6H & _WRTC_OFF_6H & _WRTD_OFF_6H
;__CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L
;__CONFIG _CONFIG7H, _EBTRB_OFF_7H
Reply
#5
Please provide a screenshot of your configs.
115200 wont work with 20MHz and without using BRG16.

Do have a working uart in your application?
Have you tried to first reset the device and then press download within 2 seconds?
Reply
#6
(2011-02-24, 20:45:44)Mikael Gustafsson Wrote: Please provide a screenshot of your configs.
115200 wont work with 20MHz and without using BRG16.

Do have a working uart in your application?
Have you tried to first reset the device and then press download within 2 seconds?

Hi Mikael

Please see screen shot of configs. I do have a working Uart in my program and if I use a 16F887 in place of the 18F4620 and use the tiny boot loader to send data it works fine. What baud rate should I be using and what is the BRG16 ?     . I have tried to reset before and after pressing the rest and then download and vise versa.

Regards
Craig
Reply
#7
9600 is good to start with. You can read about brg16 in the uart section in the data sheet.

If you use a 20MHz crystal you should set the oscillator config to HS and not Ext rc, see section 2 in the data sheet.
Reply
#8
(2011-02-24, 22:21:24)Mikael Gustafsson Wrote: 9600 is good to start with. You can read about brg16 in the uart section in the data sheet.

If you use a 20MHz crystal you should set the oscillator config to HS and not Ext rc, see section 2 in the data sheet.

Hi Mikael

I have tried everything I can think of ! Please have a look at the various attached snapshots to see if I have made a mistake somewhere.
I see that there are advanced settings in the DS30 Gui should anything be set there? I did have a good look at the data sheet for this chip and I tested my UART on my board by putting a 16F887_20Mhz chip in the place of the 18F4620_20Mhz and it works with the boot loader so I know that my RS232 is working. ( In all the applications I am using an External 20Mhz Xtal)

There must be a setting or something that I have missed, Please have a look at the data and see what you think.

Regards
Craig
(2011-02-25, 18:21:40)craig Wrote:
(2011-02-24, 22:21:24)Mikael Gustafsson Wrote: 9600 is good to start with. You can read about brg16 in the uart section in the data sheet.

If you use a 20MHz crystal you should set the oscillator config to HS and not Ext rc, see section 2 in the data sheet.

Hi Mikael

I have tried everything I can think of ! Please have a look at the various attached snapshots to see if I have made a mistake somewhere.
I see that there are advanced settings in the DS30 Gui should anything be set there? I did have a good look at the data sheet for this chip and I tested my UART on my board by putting a 16F887_20Mhz chip in the place of the 18F4620_20Mhz and it works with the boot loader so I know that my RS232 is working. ( In all the applications I am using an External 20Mhz Xtal)

There must be a setting or something that I have missed, Please have a look at the data and see what you think.

Regards
Craig

Hi Mikael

Please see the next two attachments they follow the previous five sent they would not fit on the same post.
PS. I have tried various board rates when using the DS30 Gui from 9600- 115200 but the results are all as per the attached Snapshots.[b]

Regards
Craig


Attached Files Thumbnail(s)
                           
Reply
#9
How do you set up the uart on your working application?
Reply
#10
(2011-02-28, 22:10:23)Mikael Gustafsson Wrote: How do you set up the uart on your working application?

I am using a MAX 232 Chip on my RS232 PCB and I have connected the TX pin to TX Pin 25 on the Pic (RC6) and the RX pin to Pin 26 (RC7).

Device = 18F4620
Xtal = 20
Bootloader=On
All_Digital=TRUE
Optimiser_Level=3 '
Dead_Code_Remove=On '
Keypad_Port=PORTB
PortB_Pullups = On
Stack_Size=40 '
Declare Hbus_Bitrate 400
Declare Float_Display_Type = fast '
Warnings=off
Reminders=off
Declare serial_data 8 ' Set Serin & Serout data Bits to 8
RCSTA.7 = 1

-------------------------------------------------------------------------------
Hserial_Baud = 19200 ' SET BAUD RATE TO 9600
Hserial_RCSTA = %10010000 ' ENABLE SERIAL PORT AND CONTINUOUS RECEIVE
Hserial_TXSTA = %00100100 ' ENABLE TRANSMIT AND ASYNCHRONOUS MODE
Hserial_Clear = On ' ENABLE ERROR CLEARING ON RECEIVED CHARACTERS
'-------------------------------------------------------------------------------
ADCON0 = %00001111 ' RA3 Pins set for 12vdc Battery Monitoring *****16F887**** ADCON0 = %01001101
ADCON1 = %00001101 ' ADC Setup for Battery Level Monitoring *****16F887**** ADCON1 = %11001111
ADCON2 = %10101101
Adin_Stime = 50 ' Allow 50us sample time for the ADC
'--------------------------------------------------------------------------------
TRISA=%00011100 ' Pin RA4 is the Input for the Door Switch
TRISB=%00000000
TRISC=%11000001 ' Pin C
TRISD=%00000000
TRISE=%00000000
PORTA=0
PORTB=0
PORTC=0
PORTD=0
PORTE=0

Thanks
Craig
Reply
#11
Is the uart working in your application without the bootloader?
Reply
#12
(2011-03-03, 22:38:13)Mikael Gustafsson Wrote: Is the uart working in your application without the bootloader?

I am using Flow Control (RS232) in Proton to Communicate between 2 PIC's one is a 18F4620 and the other is a 16F887. I am using the Serin/Serout Commands set at 8 Bit No Parity True (Asynchronous) and this is working perfectly all the time.

I am only using the UART for the Boot loader using a separate Max 232 chip to communicate to either PIC when needed to download updated data to either PIC (by simply moving the TX & RX wires to to correct PIC). I know that it works because if I change the PIC18F4620 device to a 16F887 in the same application then my boot loader works on it, therefore I will have two 16F887 in the same circuit talking to each other.

Regards
Craig
Reply
#13
I give up, I still don't understand if you have a working serial communication between your PIC18 and the PC.
Reply
#14
Hi, Craig

In attached *.zip file You have PIC18F4620_ds30loader.hex file

1) Program PIC18F4620_ds30loader.hex into Your PIC18F4620 (further mcu) with programmer. This *.hex file contain CONFIG fuses so you dont need to set fuses, eventually You have to turn ON option "Write CONFIG" (if that option exist in Your programmer software)

2) Be sure that mcu is running on 20MHz quartz.

3) Open ds30Loader app and select proper COM port, set baudrate of it to 19200

4) At this stage You mcu contain only bootloader and it is running it in loop all the time. So, you don't need to push reset button to initiate communication of ds30Loader app with mcu. Press Check BL button in ds30Loader and mcu has to give you the answer:
Found PIC18F4620 fw ver. 2.0.4

5) If you get answer above, thats it!


Attached Files
.zip   firmware_PIC18F.zip (Size: 55.74 KB / Downloads: 22)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)