ds30 Loader free edition forums
Can anyone Help [abandoned] - 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: Can anyone Help [abandoned] (/showthread.php?tid=83)



Can anyone Help [abandoned] - Ph1lJ - 2011-05-16

I've been trying to build a bootloader for a 16f1827. I seemed to have successfully complied the appropriate hex file using MPLAB v8.7 - I've copied to the micro, but it will not respond when using the ds30 loader - I just get a timeout.

I've tried to upload the BL as a rar file but it won't accept it.

Anybody got any ides


RE: Can anyone Help - Mikael Gustavsson - 2011-05-17

Did you try to upload a zip? I think that will work.


RE: Can anyone Help - Ph1lJ - 2011-05-17

(2011-05-17, 19:11:32)Mikael Gustafsson Wrote: Did you try to upload a zip? I think that will work.

OK here is the 16F1827 i created

;------------------------------------------------------------------------------
;
; Title: ds30 Loader for PIC12F and PIC16F
;
; File description: user settings and configuration bits
;
; Copyright: Copyright � 10-11, Mikael Gustafsson
;
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
; 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=16F1827


;------------------------------------------------------------------------------
; 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 TRISb2 ;xxx tris bit for tx enable
#define PORTB_TXE Rb2 ;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_OFF & _LVP_OFF


;------------------------------------------------------------------------------
; End of file
;------------------------------------------------------------------------------

Sorry only way I could find to get it to you.


RE: Can anyone Help - Mikael Gustavsson - 2011-05-18

Have you configured the rx and tx pins to be digital? See ANSEL register in the data sheet.


RE: Can anyone Help - Ph1lJ - 2011-05-19

(2011-05-18, 22:35:02)Mikael Gustafsson Wrote: Have you configured the rx and tx pins to be digital? See ANSEL register in the data sheet.

Well I hoped this would do that - but to no avail

#define USE_TXENABLE 1 ;xxx uncomment to use a tx enable pin
#ifdef USE_TXENABLE
#define TRISR_TXE TRISB ;xxx tris register containing tx enable
#define PORTR_TXE PORTB ;xxx port register containing tx enable
; #define TRISB_TXE TRISb2 ;xxx tris bit for tx enable
; #define PORTB_TXE Rb2 ;xxx port bit for tx enable
#define TRISB_TXE TRISB2 ;xxx tris bit for tx enable
#define PORTB_TXE RB2 ;xxx port bit for tx enable
#endif

Judging by the number of views this seems to be a popular topic.
What else can I do ?


RE: Can anyone Help - Mikael Gustavsson - 2011-05-19

Code:
Please use the code tag
Attach the modified ds30 Loader MPLAB project.


RE: Can anyone Help - Ph1lJ - 2011-05-19

(2011-05-19, 15:50:10)Mikael Gustafsson Wrote:
Code:
Please use the code tag
Attach the modified ds30 Loader MPLAB project.




RE: Can anyone Help - Mikael Gustavsson - 2011-05-22

That was only the workspace file, it's not very useful.


RE: Can anyone Help - Ph1lJ - 2011-05-24

Oop's Sorry hopefully got it all now - assuming the attachment works


RE: Can anyone Help - Mikael Gustavsson - 2011-05-25

You have NOT configured the ANSEL register.
You have uncommented tx enable, do you really use that?


RE: Can anyone Help - Ph1lJ - 2011-05-25

(2011-05-25, 20:53:00)Mikael Gustafsson Wrote: You have NOT configured the ANSEL register.
You have uncommented tx enable, do you really use that?

I thought that would configure the ANSEL reg -
To be honest - I think I'm out of my depth using this.
As much as I would love to be able to create Bootloaders for any of the Pic's I use, and from what see this seems to be an excellent way - time is not on my side.

Cheers


RE: Can anyone Help - Mikael Gustavsson - 2011-05-25

Don't you configure the ansel register in your application? Most pins are configured as analog on startup.