Modifying source file TinyBld in relation with the masterblock.
When I try to write the hex file (a simulink model build with Matlab) with TinyBld into a dspic30f4013 I get in the GUI the error:
Connected to \\.\COM3 at 115200
Searching for PIC ...Not found,
ERROR!
I really do not know the cause of this error. Till now I suppose it is coming from a wrong way of modifying the source file from the bootloader regarding frequencies and/or baud.
I build the bootloader with the following files in MPLAB:
tinybld_ds4013.s (source: Tiny website)
p30f4013.gld (source: latest C30 full version)
p30f4013.inc (source: latest C30 full version)
Furthermore, I write the produced hex file with PicKit2 into the dspic30f4013. No problem so far. Then I try to write the hex file of the simulink model into the pic (with the max232, circuit TinyBld ) and get the error (see above).
I know, I have to modify the s file: tinybld_ds4013.s with the parameters from the masterblock. I use exact the same parameters as in your website: compile your first model.
10MHz quartz, no PLL etc.
I tried several ways but till now without any succes.
Somewhere in?
Code: Select all
;********************************************************************
; Tiny Bootloader dsPIC series Size=100words
; claudiu.chiculita@ugal.ro
; http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm
;********************************************************************
.equ __30F4013, 1
.include "p30f4013.inc"
;config __FOSC, CSW_FSCM_OFF & HS;FRC & FRC_PLL4
; fedcba9876543210
; 11 FOS FPR//
; config __FOSC, 0xC302 ;HS
;config __FOSC, 0xC703
; config __FWDT, WDT_OFF
; config __FBORPOR, PBOR_OFF & MCLR_EN
; config __FGS, CODE_PROT_OFF
;check also ATIO (below)
;.equ Fcy, 5000000
;.equ baud, 19200
.equ Fcy, 7372800*4
.equ baud, 115200
.equ IdTypePIC, 0x75 ; 0x75 is also for 4011, 4012
.equ max_flash, 0x8000 ;dsPIC max address
.global __reset
.section .nbss, "b"
buff: .space 4
buffer: .space 128+6
W99: .space 2
;REGISTRY:
;W0 imediat, param nvmcon
;W1 Receive
;W2 SendL need?
;W3 count rcv
;W4 memory buffer pointer
;W5 ^
;W6 for
;W7 temp
;W8
;W9 Erase/Write Flag
;W10 delay1
;W11 delay2
;W12 EA Write
;W13 crc
;W14 void(black hole)
;W15 stack
etc..