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

Problem bootloader more timer0

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



Joined: 22 Jul 2014
Posts: 3

View user's profile Send private message

Problem bootloader more timer0
PostPosted: Tue Jul 22, 2014 7:21 pm     Reply with quote

Hello,

I have a problem with the code:
Code:

#include <18f4550.h>

#build (reset=0x400, interrupt=0x408)  //***Problem
#org 0x000, 0x3FF                               //***Problem         

#use delay(clock=48000000)
#use rs232(baud=57600, parity=N, xmit=PIN_C6, rcv=PIN_C7, bits=8)


#fuses MCLR
#FUSES HSPLL       
#FUSES PLL5       
#FUSES NOPROTECT



#int_timer0                             
void trata_timer0 ()                 
{
  int1 teste;                               
  int32 x;                                   
 
  set_timer0(147+get_timer0());
  x++;                                   
  if (x == 100000)                         
  {
   x = 0;                               
   teste = !teste;                       
   output_bit (pin_e2, teste);   
  }
}

void main ()
{
 setup_timer_0 (  RTCC_8_BIT | RTCC_DIV_1 );
 set_timer0(147);   
 enable_interrupts (global | int_timer0);
 while (true); 
 
}

If out the code:


//#build (reset=0x400, interrupt=0x408)  //***Problem
//#org 0x000, 0x3FF                               //***Problem

The 18F4550 is run normally.

How solve this problem? Because, others code run normally.

In moment this is unique code with problem.

Best regards.
Yom Kippur



Joined: 22 Jul 2014
Posts: 3

View user's profile Send private message

PostPosted: Thu Jul 24, 2014 10:19 am     Reply with quote

I usage bootloader site http://www.picprojects.net/serialbootloader/index.html

Best regards
jeremiah



Joined: 20 Jul 2010
Posts: 1358

View user's profile Send private message

PostPosted: Thu Jul 24, 2014 1:40 pm     Reply with quote

You have a typo in the code you copied from that site. Look at the #org line again on their site and compare it to yours.

EDIT:
Also, your fuses don't match those of the bootloader. That can be very dangerous. Try #fuses NONE in your code instead of the fuses you have.
Yom Kippur



Joined: 22 Jul 2014
Posts: 3

View user's profile Send private message

PostPosted: Thu Jul 24, 2014 7:26 pm     Reply with quote

Hello jeremiah,

Many,many, thank for reply.

Sorry for error in code

#build (reset=0x400, interrupt=0x408)
#org 0, 0x3FF {}

I change on ccs and error equal. But I take out all fuses of code, and run in real life. On isis the program report for me the error (stack overflow is forcing device reset).

Maybe is a small adjust in code for run perfect in isis and real life.

I try make one led on 1 second after off 1 second.

I am very intrigued because when put the code of bootloader program not run in isis, and others codes ADC, LCD and more not problem on proteus or real life.

I wait one person that usage equal bootloader for test this simple code, and reply for this error, I really not understand what is happening.

More one time, many thanks for you helping me.

Best Regards,

Yom Kippur
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