Quantcast
Channel: MEL PICBASIC Forum
Viewing all articles
Browse latest Browse all 4787

Compiling using PBP mode causes funnies

$
0
0
When I compile a programme using PBPL, our product works absolutely fine. However, when I compile using PBP the product messes around and sends an incorrect checksum.
The programme does not use Longs.

Unfortunately I am not able to share the whole code, but here is an extract where we calculate the checksum.
Programme uses DT interrupts.

Device 18F46K22
Total compiled programme 61632 bytes
PBP 2.6c
MPASM v8.63

Code:

'================================================
DOUT:  IF TX2_FLAG THEN RETURN                                'TX2 flag says we are still transmitting
                       
            DATA_OUT [1] = "*"
            DATA_OUT [2] = "D"
            DATA_OUT [3] = "*"
            DATA_OUT [4] = HEAD_OUT
            DATA_OUT [5] = FUNC_OUT
            DATA_OUT [6] = PAN_OUT
            DATA_OUT [7] = TILT_OUT
            DATA_OUT [8] = ZOOM_OUT
            DATA_OUT [9] = FOCUS_OUT
           
            TEMP2 = 0
            FOR TEMP1 = 4 TO 9
                    TEMP2 = TEMP2 + DATA_OUT [TEMP1]
          NEXT
          ERROR_OUT = TEMP2 ^ $FF
          DATA_OUT [10] = ERROR_OUT
           
            POINTER_DOUT2 = 1                                        'start with byte 1
            TX2_BYTES = 10                                                'end with byte 10
            @ INT_ENABLE TX2_INT                                'send it now via ISR
                       
                        RETURN
                       
'================================================

Is there anything I should be looking at or is this just a funny fixed in PBP3?

Viewing all articles
Browse latest Browse all 4787

Trending Articles