Tool for watching code?


Closed Thread
Results 1 to 1 of 1
  1. #1
    Join Date
    Feb 2008
    Location
    Michigan, USA
    Posts
    231

    Default Tool for watching code?

    HI all,

    This question comes from a long night of trying to guess the internals on my PIC. While trying to migrate from 16f devices to a 18F1330, I stripped down the code to the most basic part to see if I could understand how to get DT_INTs to run.
    Code:
    DEFINE OSC 8 
        clear
    ADCON0   = 0
    ADCON1  = %00001111      ' Set up ADCON1 no matter what you're doing!!!!!!                      
    T0CON   = %10000111      ' Set TMR0 Prescaler Bypassed, 
    T1CON   = %10110001      ' TMR1 ON, 1:1 prescaler 30 mS cycle, 5543 preload    
    RCON    = %00011111      ' NO Priority for interrupts
    OSCCON  = %01111100
    OSCTUNE = %11000010
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    INCLUDE "DT_INTS-18.bas"     ' Base Interrupt System
    INCLUDE "ReEnterPBP-18.bas"  ' Include if using PBP interrupts
    '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
        '   Variable definition
    ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 
    
        TRISB = %00000000                    
    ledR         var    PORTB.3                '
    ledG         var    PORTB.4                'on 18F1230
    PulseOut     var    PORTB.7
    '**************************************************************************
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
    
            INT_Handler   TMR0_INT,  _BlankGain,   PBP,  yes
            INT_Handler   TMR1_INT,  _Transmit,   PBP,  yes       
        endm
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
    
    @    INT_ENABLE  TMR0_INT
    @    INT_ENABLE  TMR1_INT     ; enable Timer 1 interrupts 
    '***************************************************************************
    Main:
    TOGGLE PulseOut             ' heartbeat without the INT
    PAUSE 500
    goto main
    
    BlankGain:          'TMR0_INT, Green LED
    TOGGLE LEDg
    TMR0L = 0
    TMR0H = 0
    @ INT_RETURN
    
    Transmit:           'TMR1_INT , RED led
    TOGGLE LEDR
    TMR1H = 0 
    TMR1L = 0
    @ INT_RETURN
    
    end
    What I found was that I had to be very careful the timing and prescaler or they started to run over each other and it locked up. The issue was that I had to guess at what was happening. In fact, I'm still not sure if I completely understand all I know about it.

    Here's the root of the question: How are you watching what is going on inside the code? I have tired on numerous occasions to use MPASM.

    I'm sure there is a way, but I have never been able to integrate it and watch while using PBP. I read and article from Chuck Hellebuyck that was suppose to explain it, but I have never got it to work for me.

    There is a Simulator from Oshonsoft that is really neat, but strictly Microchip assembly. I have managed to put it to some use, but it is tedious converting PBP to .asm just to see what's going on.

    You all can't all be going through this to produce some of the incredible solutions that I see here, are you?

    Thanks
    Bo


    I thought I had it figured out, but I left it running for that last 6 hours and when I came back, all is not well in Gotham. The Green LED is toggling, but the other two are stuck on. Not working as planned, and wondering how to determine where the issue is....
    Last edited by boroko; - 14th March 2009 at 21:46. Reason: update:

Similar Threads

  1. Minimizing code space
    By Tobias in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th May 2009, 08:25
  2. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 22:55
  3. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 22:31
  4. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 9th December 2008, 00:40
  5. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 09:26

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts