it's easier than this. Let's look at the setup SUB :
Code:
setup: ; entra en la configuracion de la circunferencia
     disable
     if portb.2 = 0 then 
          return ; HERE IS THE PROBLEM IT TAKES 20 SECONDS TO RETURN
          enable
     endif 

     x = circunferencia
     for demora = 1 to 20
          gosub display
     next

     if portb.3 = 0 then
          circunferencia = circunferencia + 1
          if circunferencia = 216 then circunferencia = 0
     endif


     goto setup
yes you enter to your setup sub but
  • 1. where is the return when PORTB.2=1 ??? Not really sure but, Now your looping maybe too much.... using a WHILE loop can maybe solve something

    2. IF PORTB.2=0 ... must be ENABLE before RETURN

try this
[code]
Code:
setup: ; entra en la configuracion de la circunferencia
     disable

     WHILE portb.2 

          x = circunferencia
          for demora = 1 to 20
               gosub display
          next

          if portb.3 = 0 then
               circunferencia = circunferencia + 1
               if circunferencia = 216 then circunferencia = 0
          endif

     WEND

     enable

     return
also i don't believe if it's a good practice to use those :
Code:
goto start

on interrupt goto tiempo

start:
remove the goto start line can maybe do something too.

This one is funny
Code:
goto main

main:
Why ?!?

Alain
Hi, 260

I feel a little strange the 2 last lines of your code ...
it never re-enables interrupts after the interrupt stubb

doesn't sound good to me ... enable should be BEFORE resume.
Look into the PBP 2.45 page 106