Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help for 16F1939 [solved]
#1
hello,
I have compiled ds30loader for my 16F1939 but when I try to send a program with the bootloader, I have a timeout.
Perhaps there is a problem with settings.inc

;------------------------------------------------------------------------------
; Device
;------------------------------------------------------------------------------
LIST P=16F1939


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


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

#define FOSC 20000000 ;xxx
#define BLTIME 3000 ;xxx time in ms before bootloader loads the user application
#define HELLOTRIES 2 ;xxx number of non hello characters received before branching to the user application


;------------------------------------------------------------------------------
; UART settings
;------------------------------------------------------------------------------
#define USE_UART1 1 ;xxx uncomment to use uart1
;#define USE_UART2 1 ;xxx uncomment to use uart2
#define BAUDRATE 9600 ;xxx baudrate
;#define USE_ABAUD 1 ;xxx auto baud rate detection, only available on enhanced mid-range devices(?)
#define USE_BRGH 1 ;xxx
;#define USE_BRG16 1 ;xxx 16-bit brg, only available on enhanced mid-range devices(?)
;#define USE_TXENABLE 1 ;xxx uncomment to use a tx enable pin
#ifdef USE_TXENABLE
#define TRISR_TXE TRISA ;xxx tris register containing tx enable
#define PORTR_TXE PORTA ;xxx port register containing tx enable
#define TRISB_TXE TRISA3 ;xxx tris bit for tx enable
#define PORTB_TXE RA3 ;xxx port bit for tx enable
#endif


;------------------------------------------------------------------------------
; Advanced settings
;------------------------------------------------------------------------------
#define BLPLW 192 ;bootloader placement, words from end, should be a multiple of 64


;------------------------------------------------------------------------------
; 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...
;------------------------------------------------------------------------------
; Standard
;__CONFIG _CONFIG1, _DEBUG_OFF &_HS_OSC & _WDT_OFF & _PWRTE_OFF & _MCLR_ON & _BODEN_OFF & _LVP_OFF
;__CONFIG _CONFIG2, _IESO_OFF & _FCMEN_OFF

; Enhanced
__CONFIG _CONFIG1, _FOSC_HS & _WDTE_OFF & _PWRTE_OFF & _MCLRE_ON & _BOREN_OFF & _IESO_OFF & _FCMEN_OFF
__CONFIG _CONFIG2, _PLLEN_ON & _LVP_OFF


Have you an idea??
Regards

Michel[/quote]
Reply
#2
Hi,
Is the uart communication working your application?
Is the clock configuration correct?
Are there any relevant errata?
Have you tried a different baud rate?
Reply
#3
Hello,
My project is a system wich manage the motors of a telescope. It's working perfectly with a 16F877 processor. We have allready a bootloader on the system, but it's not a bootloader for 16F1939. Now, we have to improve the system, and it's the reason why we change for a 16F1939, because there is more memory and also in the future, we wil change speed from 20MhZ to 32MhZ.
The bootloader we have, don't use the MCLR and perhaps it's the reason why your bootloader doesn't work. In my test I launch the loading in your program, and then switch on the system to start the bootloader. I'm going to try for an other baudrate.
I join to my message the general schema of our system.
Have you seen my seen my settings.inc?
regards


Attached Files
.pdf   Schema General MCMTII.PDF (Size: 60.97 KB / Downloads: 5)
Reply
#4
Thanks for the information but I didn't answer my questions.

You have chosen HS crystal. What is the frequency of your crystal?

You have PLL turned on, what is the multiplier?

Is oscillator frequency * PLL = 20MHz as you have specified in settings.inc?
Reply
#5
Hello,
I have select HS oscillator because my quartz is a 20MhZ.
But you are richt, the PLL should be off.
I will test that in 2 or 3 days, when I will have received my new ICD3. My ICD2 just failed yesterday.
Regards
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)