Ivan,
Try replacing the 1 with a 0. This will place the ISR at 0x0003, where
the PIC expects it.

void isr_high(void) interrupt 0 {
...

Joel

On Jan 28, 2008 12:06 PM, Ivan Petrushev <[EMAIL PROTECTED]> wrote:
> Hello,
> I'm new to SDCC and microcontrollers - my first two very simple
> programs burned into PIC16F88 and working! :)
> Now I'm trying something little harder than just lighting LEDs - I
> want to try the interrupt system.
> PIC16F88 has one external interrupt - on pin RB0.
> I'm trying the following very simple program, but something is wrong:
> #define __16f88
> #include"pic/pic16f88.h"
>
> typedef unsigned int word;
> word at 0x2007  __CONFIG = 0x3f70;
>
> void isr_high(void) interrupt 1 {
>         if (RB0 == 1) RA1 = 0;
> }
> void main(void) {
>         TRISA = 0;
>         while(1) {
>                 RA1 = 1;
>         }
> }
>
> I expect when I run this to have pin RA1 '1', untill RB0 is pulled
> '1'. Then RA1 should go '0' untill RB0 is released.
> I'm running that at gpsim and there RA1 is always '1'. When I run the
> program step by step I see it never enters the interrupt code section.
> So, how can I define an interrupt? I've searched a lot through the
> documentation of SDCC and the only piece of value I've found is the
> 'void isr_high interrupt 1' function I'm using.
>
> Is there a more complicated/simplified way to code an interrupt?
>
> Thanks,
> Ivan.
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sdcc-user
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to