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 support@ccsinfo.com

Problem with ccs bootloader

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



Joined: 04 Jun 2007
Posts: 27

View user's profile Send private message

Problem with ccs bootloader
PostPosted: Mon Jul 30, 2007 7:01 am     Reply with quote

Because i didn't find a bootloader for my pic 18f4525 i tryd the CCS one, but it didn't work - whats wrong with my code??
(I have a jumper on D7 which enables programming)


Code:

#include <18F4525.h>
#device adc=10

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES WDT128                   //Watch Dog Timer uses 1:128 Postscale
#FUSES HS                       //High speed Osc (> 4mhz)
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NOIESO                   //Internal External Switch Over mode disabled
#FUSES NOBROWNOUT               //No brownout reset
#FUSES BORV21                   //Brownout reset at 2.1V
#FUSES NOPUT                    //No Power Up Timer
#FUSES NOCPD                    //No EE protection
#FUSES NOSTVREN                 //Stack full/underflow will not cause reset
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOWRT                    //Program memory not write protected
#FUSES NOWRTD                   //Data EEPROM not write protected
#FUSES NOEBTR                   //Memory not protected from table reads
#FUSES NOCPB                    //No Boot Block code protection
#FUSES NOEBTRB                  //Boot block not protected from table reads
#FUSES NOWRTC                   //configuration not registers write protected
#FUSES NOWRTB                   //Boot block not write protected
#FUSES NOFCMEN                  //Fail-safe clock monitor disabled
//auf keinen fall XINST enablen - wird vom compiler nicht unterstützt
//#FUSES XINST                    //Extended set extension and Indexed Addressing mode enabled
#FUSES NOPBADEN                 //PORTB pins are configured as digital I/O on RESET
#FUSES LPT1OSC                  //Timer1 configured for low-power operation
#FUSES NOMCLR                   //Master Clear pin used for I/O

//Teil fuer RS232
#use delay(clock=12000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)

#define _bootloader


#include <bootloader.h>
#include <loader.c>



#org LOADER_END+2,LOADER_END+20

void application(void) {
  while(TRUE);
}

#org 0x40,0x7F

void main(void) {

   if(input(PIN_D7))//if D7 high
   {
      load_program();
   }
   application();
}

#ORG default

#int_global
void isr(void) {
   jump_to_isr(LOADER_END+5*(getenv("BITS_PER_INSTRUCTION")/8));
}



Then I send the CCS testprogramm with SIOW:

Code:


#include "main.h"          //fuer Kunfiguration PIC - z.B.RS232 oder I2C

#include <bootloader.h>

void main(void) {
   int i=0;

   printf("\r\nApplication program version 1.00 \r\n");

   while(TRUE)
     printf("%u ",++i);

}



Whats wrong? Nothing happens after I send the bootload file Confused
cyberant



Joined: 04 Jun 2007
Posts: 27

View user's profile Send private message

PostPosted: Mon Jul 30, 2007 8:03 am     Reply with quote

OK i found it - nothing wrong - I used open file to send the hex file via SIOW but it only works with "download Software". Smile
Does anyone know how to send the hex filie the same way as SIOW sends it with "download Software" via hyperterminal?
jma_1



Joined: 08 Feb 2005
Posts: 147
Location: Wisconsin

View user's profile Send private message

PostPosted: Tue Jul 31, 2007 6:16 am     Reply with quote

Greetings,

Hyperterminal -> Transfer -> Send Text File

Hyperterminal is not as nice as SIOW and does not support non-standard COMM ports.

Cheers,
JMA
cyberant



Joined: 04 Jun 2007
Posts: 27

View user's profile Send private message

PostPosted: Tue Jul 31, 2007 3:34 pm     Reply with quote

Thanks - it worked - but now I have the Problem that if I send a larger File via Hyperterminal it does not finish transfering. Via SIOW it works without problems. With the small testfile Hyperterminal transfers completely and the Programm works but if I send a larger one it doesn't stop transfering?? strange... Confused
(Ive waited 10 mins and via siow it finishes in ~1 min)
jma_1



Joined: 08 Feb 2005
Posts: 147
Location: Wisconsin

View user's profile Send private message

PostPosted: Tue Jul 31, 2007 3:50 pm     Reply with quote

Greetings,

If you notice with SIOW, when loading software the PIC responds with an ACK sequence after correctly receiving each record of the hex file. The source file says it also uses XON / XOFF flow control -> putchar(XON) and putchar (XOFF). Both of these are probably causing Hyperterminal to pause when sending the file.

Try changing the setup of the serial port in Hyperterminal to incorporate the flow control when sending the file. Alternately, use a different program like TeraTerm http://hp.vector.co.jp/authors/VA002416/teraterm.html

Do you need to use Hyperterminal? It's a quirky program at best. CCS recently started advertising a redistributable version of SIOW which might work for your situation?

Cheers,
JMA
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