CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

TINY Bootloader at a 18F2585

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mkkirchner



Joined: 30 Dec 2010
Posts: 3

View user's profile Send private message

TINY Bootloader at a 18F2585
PostPosted: Thu Dec 30, 2010 10:38 am     Reply with quote

Hi,
I use TINY Bootloader and the CCS compiler and I have the following problems with a 18F2585:

If I flash my Pic with a small test program directly, every works fine.

If I use the bootloader and flash the pic with my test program by the bootloader, the delay times (delay_ms(100)) are wrong, and the variables which I print out over the RS232 are also wrong (every time 0).

The Bootloader:
Code:

   radix DEC
   LIST      P=18F2585   ; change also: Configure->SelectDevice from Mplab
xtal EQU 20000000      ; you may want to change: _XT_OSC_1H  _HS_OSC_1H  _HSPLL_OSC_1H
baud EQU 115200         ; the desired baud rate
delaytime EQU 2000000   ; for 40MHz: 1000000 gets about 1sec, for 20MHZ: 2000000 gets about 1sec
   ; The above 4 lines can be changed and buid a bootloader for the desired frequency (and PIC type)
   ;********************************************************************
   ;   Tiny Bootloader      18F series      Size=100words
   ;   claudiu.chiculita@ugal.ro
   ;   http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm
   ;********************************************************************
   


   #include "../icdpictypes.inc"   ;takes care of: #include "p18fxxx.inc",  max_flash, IdTypePIC
   #include "../spbrgselect.inc"   ; RoundResult and baud_rate

      #define first_address max_flash-200      ;100 words
   
   ;can we dump these ? winpic etc have the function of configuring all

   __CONFIG _CONFIG1H, _OSC_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
;   __CONFIG _CONFIG2L, _PWRT_OFF_2L & _BOREN_OFF_2L
;   __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_1_2H
;   __CONFIG _CONFIG3H, _MCLRE_ON_3H & _PBADEN_OFF_3H ;& _CCP2MX_PORTBE_3H not in 4680
;   __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
;   __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L
;   __CONFIG _CONFIG6H, _WRTB_OFF_6H & _WRTC_OFF_6H
;   __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L
;   __CONFIG _CONFIG7H, _EBTRB_OFF_7H & _DEVID1 & _IDLOC0



And the small test program:
Code:

while(1)
     {             
     i++;                   
     U=4;
      output_high(PIN_C4);
      delay_ms(1000);
      output_high(PIN_C5);                                                                                       
      delay_ms(1000);
      output_low(PIN_C5);
      output_low(PIN_C4);
      delay_ms(1000);
      printf("SS I=%lu  Xc=%c   Xd%d  Ud=%ld\r\n",i,x,x,u);
     }

Can anybody help??
Thanks

martin
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Dec 30, 2010 12:44 pm     Reply with quote

Quote:
And the small test program:
Code:

Post the complete small test program that has:
1. The #include for the PIC.
2. The #fuses.
3. The #use delay().
4. The main() function.

Post the frequency of the crystal that is connected to the PIC.
mkkirchner



Joined: 30 Dec 2010
Posts: 3

View user's profile Send private message

PostPosted: Thu Dec 30, 2010 1:45 pm     Reply with quote

Thanks, It runs now. With the DS30 Bootloader and the same test program it was no problem.

Why it did not work with Tiny ??

Thanks

martin
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group