|
|
View previous topic :: View next topic |
Author |
Message |
Yom Kippur
Joined: 22 Jul 2014 Posts: 3
|
Problem bootloader more timer0 |
Posted: Tue Jul 22, 2014 7:21 pm |
|
|
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
|
|
|
jeremiah
Joined: 20 Jul 2010 Posts: 1353
|
|
Posted: Thu Jul 24, 2014 1:40 pm |
|
|
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
|
|
Posted: Thu Jul 24, 2014 7:26 pm |
|
|
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 |
|
|
|
|
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
|