Announcement

Collapse
No announcement yet.

ASM Interrupts & Variables (K42)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ASM Interrupts & Variables (K42)

    I'm using a PIC18F14K50 as a USB translator that talks to the PC and to a "Master Controller", a PIC18F26K42 (the K42 being the focus of this post). The USB part is working. The USB Packet consists of a Command Code and 8 Data Bytes (iCmd & iDat[8] for PIC-to-PC and oCmd & oDat[8] for PC to PIC). With a PicoScope Logic Analyzer I've verified UART transmissions; BAUD is correct, format is correct, etc. I've disabled Vectored and Priority Interrupts on the K42. I'm using "DEFINE INTHAND Sort" with an ASM ISR. I've defined an array to store incoming bytes from the PC (passed on by the K50) as they arrive with a counter (byte variable "Pct") to track array offset (PcIn[Pct]). The ISR receives a byte, transfers it from U2RXB to pTemp (MOVFFL U2RXB, pTemp), sets a flag (BSF PC_In ;which is Work.4), clears the U2RXIF, then RETFIE. From the Main loop I poll this PC_In flag:
    Code:
        IF PC_In = 1 THEN                       ;A USB Byte Has Arrived, PC_In Set in Get_PC of ISR
            GOSUB RedI
        ENDIF
    If the Command code (which would be oCmd from the USB) is => $60 it is a Request code requesting a data packet. The K50 filters this and will only send 1 byte when it's a Request. Otherwise, incoming bytes are packed into the array "PcIn[Pct]", where Pct is the variable used for the offset. The RedI subroutine checks oCmd for Requests (where the Pct offset variable = 0) with IF/THEN and calls SendP_Data to send requested data packets. Otherwise, it moves the received byte from pTemp to PcIn[Pct].
    Code:
    RedI:
        IF Pct = 0 THEN                         ;First Byte of Packet, oCmd
            IF pTemp > $5F THEN                ;Request Code
                GOSUB SendP_Data
            ENDIF
        ENDIF
        PcIn[Pct] = pTemp                       ;Move Byte to Array
        PC_In = 0                               ;Clear Flag
        Pct = Pct + 1                           ;INC Counter
        IF Pct = 9 THEN                         ;If Array Full...
            pPac = 1                            ;Set Flag
            Pct = 0                             ;Clear Counter
        ENDIF
    @   CLRWDT
    RETURN
    When a full packet has arrived (Pct = 9) another flag is set; pPac = 1. From the Main loop, I'm polling for this flag:
    Code:
        IF pPac = 1 THEN                        ;Full USB Packet Has Arrived
            GOSUB Red_Phone.               ;Call from the President
        ENDIF
    The subroutine Red_Phone then disseminates the PcIn packet.
    Code:
    Red_Phone:
        SELECT CASE PcIn[0]                ;oCmd
            CASE $40
                FOR b0 = 0 TO 7
                    b1 = b0 + 1
                    EHI[b0] = PcIn[b1]           ;Load the Array
                NEXT b0
                DO
                    LOOP WHILE PIR6.3 = 0   ;Wait till U2TXB is Empty
                U2TXB = Ack                       ;Acknowledge Receive
            CASE $41
                FOR b0 = 8 TO 15
                    b1 = b0 - 7
                    EHI[b0] = PcIn[b1]
                NEXT b0
                DO
                    LOOP WHILE PIR6.3 = 0
                U2TXB = Ack
    . . . . . . . . . . . . . . . . . . . . . .
            CASE $4A
                CcDc = PcIn[1]
                CcWot = PcIn[2]
                Secs = PcIn[3]
                bConf = PcIn[4]
                DO
                    LOOP WHILE PIR6.3 = 0
                U2TXB = Ack
            CASE ELSE
                GOSUB SendP_Data
        END SELECT
        PC_In = 0                                        ;Clear the ISR-Set Flag
        Pct = 0                                             ;Clear the Array Offset
        pPac = 0                                          ;Set the "Packet Full" Flag
    @   CLRWDT
    RETURN
    Because of the ASM ISR I've declared some variables as SYSTEM and some specifically in the Access Bank. One example:
    Code:
    Work        VAR     BYTE BANKA SYSTEM             ;Source of Working Bits
     Dat        VAR     Work.0                  ;UART1 Data Has Arrived from Hhombre
     Time       VAR     Work.1                  ;Seconds Have Been Decremented in ISR
     CPS        VAR     Work.2                  ;RPM Numbers are In
     Cold       VAR     Work.3                  ;Cold-Start Ramp-In, 0 = Cold, 1 = Warm
     PC_In      VAR     Work.4                  ;UART2 Data Has Arrived from PC/Laptop
     Dry        VAR     Work.5                  ;Rprb = 1
     pPac       VAR     Work.6                  ;Full USB Packet Has Arrived
    -- ********
    -- ** This brings me to question number 1: Using generic variables (b0 & b1) in FOR/NEXT LOOPs, I'm getting 5 bytes of data instead of 9. I tried specifying an address for these ISR variables:
    Code:
    Work        VAR     BYTE SYSTEM             ;Source of Working Bits
    @Work       EQU     0x005F                  ;Places Work at End of Access Bank 
     Dat        VAR     Work.0                  ;UART1 Data Has Arrived from Hhombre
    .............
    The Compiler says I'm declaring the same thing twice and says it in RED. I decided to try this because I'm wondering if the Compiler is overlapping addresses because of my ASM code. This may explain a number of corruptions while the code executes.

    ---********
    -- ** Question number 2: On start up, the PC sends multiple Requests for data to load parameters & variables from the controller. It then toggles between 2 Requests for constantly changing data. The K42 occasionally responds to Requests in a timely manner, but more often it has a serious delay (and eventually seems to stop responding altogether). I started at 4 MHz Fosc then increased it to 16 MHz to see if that would help. It made no difference. I tried to upload the complete code as .txt, but it was more than double the allowable upload size.

    I've been debugging for a week now and am running out of options and time (I was supposed to deliver this bugger this past Monday!!). Thanks in advance for any insight you can offer.

    Some notes about the code:
    - I'm using PBP3.1 v.3.1.2.4; Micro Code Studio v.5.0.0.5; MPLABX v.5.15; Windows 10
    - ASM ISR is "Sort" near the top
    - Within Sort, the UART2 routine is "Get_PC"
    - The K42 uses both MOVFF and MOVFFL. I used MOVFFL just to be sure
    - This version doesn't compile because of "@Hin0 EQU 0x0058 ;Places Hin0 in Access Bank at specific address 0x0058. Comment them out & it compiles. However...
    - I tried "Hin0 VAR BYTE BANKA SYSTEM" previously, which compiles, but places Hin0 anywhere in the Access Bank, which may be an issue
    - Tach is a WORD sized variable that uses TMR1H as Tach.HIGHBYTE and TMR1L as Tach.LOWBYTE. The following lines allow manipulation is the ASM ISR:
    Code:
    Tach        VAR     WORD BANKA SYSTEM             ;(TachH << 8) | TachL
    @TachL      EQU     Tach                    ;TMR1L RPM Value
    @TachH      EQU     Tach + 1                ;TMR1H RPM Value
    - In Start2 I'm looping through waiting for a delay (rDel is the variable) to time out. The commented out code was used to debug UART2 U2TXB function. One note here is that I should have seen a single b1 value output, then a rather lengthy pause. What I actually got was rapid-fire output with no delays. (Again, was a variable being corrupted??)
    - Originally I only polled for PC_In once per loop. To find out why I was missing Requests I placed the poll every other function, which didn't help:
    Code:
        IF PC_In = 1 THEN                       ;A USB Byte Has Arrived, PC_In Set in Get_PC of ISR
            GOSUB RedI
        ENDIF
    We can crack this cotton PIC'n thang!

  • #2
    Relevant code:
    Code:
    ; --- *** Compiler DEFINEs: *** ---
    DEFINE      OSC         16
    DEFINE      INTHAND     Sort
    DEFINE      NO_CLRWDT   1
    
    ; --- *** Interrupt Service Handler: *** ---
    ASM
    Sort:
        BANKSEL     U1ERRIR
        BTFSC       U1ERRIR, 3                  ;FERIF
        GOTO        Fer1                        ;Clear U1 Framing Error
        BTFSC       U2ERRIR, 3                  ;FERIF
        GOTO        Fer2                        ;Clear U1 Framing Error
        BANKSEL     PIR3
        BTFSC       PIR3, 3                     ;U1RXIF
        GOTO        Get_Hom                     ;IF U1RXIF, GOTO Get_Hom
        BTFSC       PIR4, 1                     ;T1GIF
        GOTO        Get_CPS                     ;IF T11GIF, GOTO Get_CPS
        BTFSC       PIR6, 2                     ;U2RXIF
        GOTO        Get_PC                      ;IF U2RXIF, GOTO Get_PC
        BTFSC       PIR7, 0                     ;TMR4IF
        GOTO        CD                          ;IF TMR4IF, GOTO CD (CountDown)
        GOTO        GoHome                      ;ELSE, Give Up
    Get_PC:                                     ;Receive Data from PC/Laptop, UART2
        BANKSEL     U2ERRIR
        BTFSC       U2ERRIR, RXFOIF                ; Check for overflow error
        BCF         U2ERRIR, RXFOIF                ; Clear overflow error flag
        MOVFFL      U2RXB, pTemp                ;Move Data Byte from Receive Register to pTemp
        ;BCF         U2ERRIR, 1                  ;R2FOIF
        BANKSEL     PIR6
        BCF         PIR6, 2                     ;Clear U2RXIF
        BANKSEL     Work
        BSF         Work, 4                     ;PC_In = 1
        BRA         GoHome
    GoHome:
        RETFIE
    ENDASM
    
    ; -=- UART Related SFRs; UART1 == Hhombre, UARAT2 == USB: -=-
    U2CON0          =   %00110000               ;.7 = BRGH
    U2CON1          =   %00000000               ;.7 = 1/0 (ON)
    U2CON2          =   %00000000               ;Legacy Mode
    ;U2TXB          ;UART2 Transmit Register
    ;U2RXB          ;UART2 Receive Register
    U2BRGL          =   $33                     ;51d, 19.2k Baud
    U2BRGH          =   0
    PIE6.2          =   0                       ;U2RXIE
    PIE6.3          =   0                       ;U2TXIE
    PIE6.4          =   0                       ;U2EIE (Framing Error)
    
    Start2:
    '''    b0 = b0 + 1
    '''    IF b0 = 100 THEN
    '''        FOR b1 = 7 TO 15
    '''            DO
    '''                LOOP WHILE PIR6.3 = 0
    '''            U2TXB = b1
    '''        NEXT b1
    '''        b0 = 0
    ''    ENDIF
        IF PC_In = 1 THEN                       ;A USB Byte Has Arrived, PC_In Set in Get_PC of ISR
            GOSUB RedI
        ENDIF
        IF pPac = 1 THEN                        ;Full USB Packet Has Arrived
            GOSUB Red_Phone
        ENDIF
        GOTO Start2
    
    RedI:
        IF Pct = 0 THEN                         ;First Byte of Packet
            IF pTemp > $5F THEN                ;Request Code
                GOSUB SendP_Data
            ENDIF
        ENDIF
        PcIn[Pct] = pTemp                       ;Move Byte to Array
        PC_In = 0                               ;Clear Flag
        Pct = Pct + 1                           ;INC Counter
        IF Pct = 9 THEN                         ;If Array Full...
            pPac = 1                            ;Set Flag
            Pct = 0                             ;Clear Counter
        ENDIF
    @   CLRWDT
    RETURN
    
    Red_Phone:
        SELECT CASE PcIn[0]
            CASE $40
                FOR b0 = 0 TO 7
                    b1 = b0 + 1
                    EHI[b0] = PcIn[b1]
                NEXT b0
                DO
                    LOOP WHILE PIR6.3 = 0
                U2TXB = Ack
            CASE $41
                FOR b0 = 8 TO 15
                    b1 = b0 - 7
                    EHI[b0] = PcIn[b1]
                NEXT b0
                DO
                    LOOP WHILE PIR6.3 = 0
                U2TXB = Ack
            CASE $42
                FOR b0 = 16 TO 23
                    b1 = b0 - 15
                    EHI[b0] = PcIn[b1]
                NEXT b0
                DO
                    LOOP WHILE PIR6.3 = 0
                U2TXB = Ack
            CASE $43
                FOR b0 = 24 TO 31
                    b1 = b0 - 23
                    EHI[b0] = PcIn[b1]
                NEXT b0
                DO
                    LOOP WHILE PIR6.3 = 0
                U2TXB = Ack
            CASE $44
                FOR b0 = 32 TO 39
                    b1 = b0 - 31
                    EHI[b0] = PcIn[b1]
                NEXT b0
                DO
                    LOOP WHILE PIR6.3 = 0
                U2TXB = Ack
            CASE $45
                FOR b0 = 40 TO 47
                    b1 = b0 - 39
                    EHI[b0] = PcIn[b1]
                NEXT b0
                DO
                    LOOP WHILE PIR6.3 = 0
                U2TXB = Ack
            CASE $46
                FOR b0 = 48 TO 55
                    b1 = b0 - 47
                    EHI[b0] = PcIn[b1]
                NEXT b0
            CASE $47
                FOR b0 = 56 TO 63
                    b1 = b0 - 55
                    EHI[b0] = PcIn[b1]
                NEXT b0
                DO
                    LOOP WHILE PIR6.3 = 0
                U2TXB = Ack
            CASE $48
                FOR b0 = 0 TO 7
                    b1 = b0 + 1
                    Hhom[b0] = PcIn[b1]
                NEXT b0
                DO
                    LOOP WHILE PIR6.3 = 0
                U2TXB = Ack
                U1TXB = $48
                FOR b0 = 0 TO 7
                    b1 = b0 + $20
                    DO
                        LOOP WHILE U1FIFO.5 = 0
                    U1TXB = b1
                    DO
                        LOOP WHILE U1FIFO.5 = 0
                    U1TXB = Hhom[b0]
                NEXT b0
                DO
                    LOOP WHILE U1FIFO.5 = 0
            CASE $49
                FOR b0 = 0 TO 7
                    b1 = b0 + 1
                    IaTab[b0] = PcIn[b1]
                NEXT b0
                DO
                    LOOP WHILE PIR6.3 = 0
                U2TXB = Ack
            CASE $4A
                CcDc = PcIn[1]
                CcWot = PcIn[2]
                Secs = PcIn[3]
                bConf = PcIn[4]
                DO
                    LOOP WHILE PIR6.3 = 0
                U2TXB = Ack
            CASE ELSE
                GOSUB SendP_Data
        END SELECT
        PC_In = 0
        Pct = 0
        pPac = 0
    @   CLRWDT
    RETURN
    We can crack this cotton PIC'n thang!

    Comment


    • #3
      Code:
      SendP_Data:
          SELECT CASE PcIn[0]
              CASE $60                            ;Request EHI X[0]
                  PcOut[0] = $40                  ;iCmd = $40
      '            FOR b0 = 1 TO 8
      '                b1 = b0 - 1
      '                PcOut[b0] = EHI[b1]
      '            NEXT b0
                  PcOut[1] = EHI[0]
                  PcOut[2] = EHI[1]
                  PcOut[3] = EHI[2]
                  PcOut[4] = EHI[3]
                  PcOut[5] = EHI[4]
                  PcOut[6] = EHI[5]
                  PcOut[7] = EHI[6]
                  PcOut[8] = EHI[7]
                  GOTO Ship_Pc                   ;PcOut is Packed and Ready to Ship
              CASE $61                            ;Request EHI X[1]
                  PcOut[0] = $41
      '            FOR b0 = 8 TO 15
      '                b1 = b0 - 7
      '                PcOut[b1] = EHI[b0]
      '            NEXT b0
                  PcOut[1] = EHI[8]
                  PcOut[2] = EHI[9]
                  PcOut[3] = EHI[10]
                  PcOut[4] = EHI[11]
                  PcOut[5] = EHI[12]
                  PcOut[6] = EHI[13]
                  PcOut[7] = EHI[14]
                  PcOut[8] = EHI[15]
                  GOTO Ship_Pc                   ;PcOut is Packed and Ready to Ship
              CASE $62                            ;Request EHI X[2]
                  PcOut[0] = $42
      '            FOR b0 = 16 TO 23
      '                b1 = b0 - 15
      '                PcOut[b1] = EHI[b0]
      '            NEXT b0
                  PcOut[1] = EHI[16]
                  PcOut[2] = EHI[17]
                  PcOut[3] = EHI[18]
                  PcOut[4] = EHI[19]
                  PcOut[5] = EHI[20]
                  PcOut[6] = EHI[21]
                  PcOut[7] = EHI[22]
                  PcOut[8] = EHI[23]
                  GOTO Ship_Pc                   ;PcOut is Packed and Ready to Ship
              CASE $63                            ;Request EHI X[3]
                  PcOut[0] = $63
      '            FOR b0 = 24 TO 31
      '                b1 = b0 - 23
      '                PcOut[b1] = EHI[b0]
      '            NEXT b0
                  PcOut[1] = EHI[24]
                  PcOut[2] = EHI[25]
                  PcOut[3] = EHI[26]
                  PcOut[4] = EHI[27]
                  PcOut[5] = EHI[28]
                  PcOut[6] = EHI[29]
                  PcOut[7] = EHI[30]
                  PcOut[8] = EHI[31]
                  GOTO Ship_Pc                   ;PcOut is Packed and Ready to Ship
              CASE $64                            ;Request EHI X[4]
                  PcOut[0] = $44
      '            FOR b0 = 32 TO 39
      '                b1 = b0 - 31
      '                PcOut[b1] = EHI[b0]
      '            NEXT b0
                  PcOut[1] = EHI[32]
                  PcOut[2] = EHI[33]
                  PcOut[3] = EHI[34]
                  PcOut[4] = EHI[35]
                  PcOut[5] = EHI[36]
                  PcOut[6] = EHI[37]
                  PcOut[7] = EHI[38]
                  PcOut[8] = EHI[39]
                  GOTO Ship_Pc                   ;PcOut is Packed and Ready to Ship
              CASE $65                            ;Request EHI X[5]
                  PcOut[0] = $45
      '            FOR b0 = 40 TO 47
      '                b1 = b0 - 39
      '                PcOut[b1] = EHI[b0]
      '            NEXT b0
                  PcOut[1] = EHI[40]
                  PcOut[2] = EHI[41]
                  PcOut[3] = EHI[42]
                  PcOut[4] = EHI[43]
                  PcOut[5] = EHI[44]
                  PcOut[6] = EHI[45]
                  PcOut[7] = EHI[46]
                  PcOut[8] = EHI[47]
                  GOTO Ship_Pc                   ;PcOut is Packed and Ready to Ship
              CASE $66                            ;Request EHI X[6]
                  PcOut[0] = $46
      '            FOR b0 = 48 TO 55
      '                b1 = b0 - 47
      '                PcOut[b1] = EHI[b0]
      '            NEXT b0
                  PcOut[1] = EHI[48]
                  PcOut[2] = EHI[49]
                  PcOut[3] = EHI[50]
                  PcOut[4] = EHI[51]
                  PcOut[5] = EHI[52]
                  PcOut[6] = EHI[53]
                  PcOut[7] = EHI[54]
                  PcOut[8] = EHI[55]
                  GOTO Ship_Pc                   ;PcOut is Packed and Ready to Ship
              CASE $67                            ;Request EHI X[7]
                  PcOut[0] = $47
      '            FOR b0 = 56 TO 63
      '                b1 = b0 - 55
      '                PcOut[b1] = EHI[b0]
      '            NEXT b0
                  PcOut[1] = EHI[56]
                  PcOut[2] = EHI[57]
                  PcOut[3] = EHI[58]
                  PcOut[4] = EHI[59]
                  PcOut[5] = EHI[60]
                  PcOut[6] = EHI[61]
                  PcOut[7] = EHI[62]
                  PcOut[8] = EHI[63]
                  GOTO Ship_Pc                   ;PcOut is Packed and Ready to Ship
              CASE $68                            ;Request Hhom Table
                  PcOut[0] = $48
      '            FOR b0 = 0 TO 7
      '                b1 = b0 + 1
      '                PcOut[b1] = Hhom[b0]
      '            NEXT b0
                  PcOut[1] = Hhom[0]
                  PcOut[2] = Hhom[1]
                  PcOut[3] = Hhom[2]
                  PcOut[4] = Hhom[3]
                  PcOut[5] = Hhom[4]
                  PcOut[6] = Hhom[5]
                  PcOut[7] = Hhom[6]
                  PcOut[8] = Hhom[7]
                  GOTO Ship_Pc                   ;PcOut is Packed and Ready to Ship
              CASE $69                            ;Request IATimer Table
                  PcOut[0] = $49
      '            FOR b0 = 0 TO 7
      '                b1 = b0 + 1
      '                PcOut[b1] = IaTab[b0]
      '            NEXT b0
                  PcOut[1] = IaTab[0]
                  PcOut[2] = IaTab[1]
                  PcOut[3] = IaTab[2]
                  PcOut[4] = IaTab[3]
                  PcOut[5] = IaTab[4]
                  PcOut[6] = IaTab[5]
                  PcOut[7] = IaTab[6]
                  PcOut[8] = IaTab[7]
                  GOTO Ship_Pc                   ;PcOut is Packed and Ready to Ship
              CASE $6A
                  PcOut[0] = $4A
                  PcOut[1] = CcDc
                  PcOut[2] = CcWot
                  PcOut[3] = CcDc
                  PcOut[4] = Secs
                  PcOut[5] = bConf
                  FOR b0 = 6 TO 8
                      PcOut[b0] = 0
                  NEXT b0
                  GOTO Ship_Pc                   ;PcOut is Packed and Ready to Ship
              CASE $6B                            ;Request Data0 Packet
                  PcOut[0] = $4B
                  PcOut[1] = TPS
                  PcOut[2] = CTS
                  PcOut[3] = Atmp
                  PcOut[4] = RPM.HIGHBYTE
                  PcOut[5] = RPM.LOWBYTE
                  PcOut[6] = Amps
                  PcOut[7] = HhDc
                  PcOut[8] = Load
                  GOTO Ship_Pc                   ;PcOut is Packed and Ready to Ship
              CASE $6C                            ;Request Data1 Packet
                  PcOut[0] = $4C
                  ;READ 82,StSec
                  PcOut[1] = StSec
                  PcOut[2] = ePwm                 ;Actual EHI PWM DC%
                  PcOut[3] = Water
                  FOR b0 = 4 TO 8
                      PcOut[b0] = 0
                  NEXT b0
                  GOTO Ship_Pc                   ;PcOut is Packed and Ready to Ship
              CASE $70
                  DO
                      LOOP WHILE PIR6.3 = 0
                  U2TXB = Ack
                  U1TXB = $70
                  GOSUB Prog_Tables
              CASE $71
                  DO
                      LOOP WHILE PIR6.3 = 0
                  U2TXB = Ack
                  U1TXB = $71
                  GOSUB Load_Tables
      '        CASE ELSE
      '            U2TXB = Nack
          END SELECT
      @   CLRWDT
      RETURN
      
      Ship_Pc:
      ;    FOR PctO = 0 TO 8
      '        DO
      '            LOOP WHILE PIR6.3 = 0
      '        U2TXB = PcOut[PctO]
      ;        PctO = PctO + 1
      ;    NEXT PctO
          DO
              LOOP WHILE PIR6.3 = 0
          U2TXB = PcOut[0]
          DO
              LOOP WHILE PIR6.3 = 0
          U2TXB = PcOut[1]
          DO
              LOOP WHILE PIR6.3 = 0
          U2TXB = PcOut[2]
          DO
              LOOP WHILE PIR6.3 = 0
          U2TXB = PcOut[3]
          DO
              LOOP WHILE PIR6.3 = 0
          U2TXB = PcOut[4]
          DO
              LOOP WHILE PIR6.3 = 0
          U2TXB = PcOut[5]
          DO
              LOOP WHILE PIR6.3 = 0
          U2TXB = PcOut[6]
          DO
              LOOP WHILE PIR6.3 = 0
          U2TXB = PcOut[7]
          DO
              LOOP WHILE PIR6.3 = 0
          U2TXB = PcOut[8]
          PctO = 0
      ;    pPac = 0
          PC_In = 0
      @   CLRWDT
      RETURN
      We can crack this cotton PIC'n thang!

      Comment


      • #4
        Mike, I don't think you have all the code here. I see the lines:

        GOTO Get_CPS ;IF T11GIF, GOTO Get_CPS

        and also:

        GOTO CD ;IF TMR4IF, GOTO CD (CountDown)

        but I see NO Entry points.
        Dave Purola,
        N8NTA
        EN82fn

        Comment


        • #5
          i'm not surprised the compiler spits this out, its not a safe way to allocate ram anyw
          Work VAR BYTE SYSTEM ;Source of Working Bits
          @Work EQU 0x005F ;Places Work at End of Access Bank

          i would do it like this
          Work VAR BYTE $5f SYSTEM ;Source of Working Bitss at End of Access Bank
          @Work = _Work ;have an asm label point to pbp var





          Comment


          • #6
            Originally posted by DavidP View Post
            Mike, I don't think you have all the code here. I see the lines:

            GOTO Get_CPS ;IF T11GIF, GOTO Get_CPS

            and also:

            GOTO CD ;IF TMR4IF, GOTO CD (CountDown)

            but I see NO Entry points.
            I couldn't load the complete PBP file. In fact, I had to break down what code I did post over several posts. Get_CPS is tied to TMR1GIF for speed calculations, while CD is tied to a Seconds counter for a ramp-in cycle.

            Thanks for the replies.
            We can crack this cotton PIC'n thang!

            Comment


            • #7
              Spent some time converting to Vectored Interrupts, then I noticed a variable that was wrong. Either way, I got it working now.
              We can crack this cotton PIC'n thang!

              Comment

              Working...
              X