View previous topic :: View next topic |
Author |
Message |
tapasdas000
Joined: 02 Apr 2009 Posts: 5
|
how to run #int_ext with tiny bootloader |
Posted: Thu Apr 02, 2009 7:32 am |
|
|
Hi I am using tinyPIC bootloader 16f877a 20 mhz but I am unable use int_ext.
Can anybody help ?
I have already tried this code:
Code: | #build(reset=0x1, interrupt=0x8)
#ORG 0x0F00,0x0FFF {} |
But no use.
With hardware it's not working. |
|
|
Heath
Joined: 21 Dec 2007 Posts: 41
|
|
Posted: Thu Apr 02, 2009 8:34 am |
|
|
Post a simple program that illustrates your problem please. |
|
|
tapasdas000
Joined: 02 Apr 2009 Posts: 5
|
THANKS FOR RESPOND |
Posted: Thu Apr 02, 2009 1:03 pm |
|
|
My code is simple test code.
Actually I am interfacing PIC16f877a with cc1100 Texas IC which is a 1 ghz transceiver
Initially I am checking external interrupt with simple test code. I am a new user to this Tiny bootloader. I am using it because my laptop doesn't support serial port so I am using usb to serial converter. But winpic programmer doesn't support this usb to serial converter so I my only option is this Tiny bootloader.
So I have to test if the external interrupt is working so that I can use it for my above application later.
So here is my test code:
Code: | #include<16f877a.h>
#build(reset=0x1, interrupt=0x8)
#ORG 0x0F00,0x0FFF {}
#use delay(clock=20000000)
int x; //global variable
//Here is the ISR
# INT_EXT
PortB_Interrupt()
{
x=x+1;
}
void main(void)
{
x = 1; //Initialize x
OPTION_REG=0x07; //portb pull up
enable_interrupts(GLOBAL); //Turn on interrupts
enable_interrupts(INT_EXT); //Enable INT_EXT
ext_int_edge( H_TO_L );
while(1) {
output_c(x);
}
} |
and my tyni bootloader version is 1.9.8
with the mplab simulator its works fine but with hardware it is not working
i think some probelem with interrupt vector 0x0004 |
|
|
Guest
|
|
Posted: Thu Apr 02, 2009 3:12 pm |
|
|
Hi
Maybe first try your code without the boot loader, if working try it with the loader.
You miss all the !!!
And when I use the boot loader I don't use any of:
Code: | #build(reset=0x1, interrupt=0x8)
#ORG 0x0F00,0x0FFF {} |
And try to use CCS way to make init of the PIC:-) |
|
|
tapasdas000
Joined: 02 Apr 2009 Posts: 5
|
|
Posted: Thu Apr 02, 2009 7:00 pm |
|
|
hi thanks but I did not miss but I am using my own header file and in that I have made #FUSE and my #FUSE is
Code: | #FUSES XT, BROWNOUT, NOWDT,NOLVP |
I want to tell that my code is working fine except the interrupt part.
You maybe ignored it but I have initialized
and am outputting it on portc by
and I am getting Port C as 1 on my hardware using the Tiny bootloader. The rest of the code is working fine except the isr part.
So is there any solution to it?
|
|
|
tapasdas000
Joined: 02 Apr 2009 Posts: 5
|
|
Posted: Fri Apr 03, 2009 2:52 am |
|
|
please is there any export out there who can help me with the above problem |
|
|
|