How to Figure Out Compile Errors?


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: How to Figure Out Compile Errors?

    Datasheet's with combined PICs drive me nuts, but in most cases I've seen so far it's usually just 2 PICs; this is the first time I've run across one which has 6 and only some have ECCP modules (I think the 16F690 has it, which may be why a search through the datasheet comes up with 'CCP1CON'.

    I trimmed the code to test and left out the definition of BLINKYFREQ - even with it back in, though, it still doesn't compile (same reason).

    For the 8 pins together, its because of this cool code from Darrel:

    Code:
    ;----[Main Program Loop]----------------------------------------
    Main: 
        ' Check if flash mode has changed
        IF FlashMode <> Old_FlashMode Then
            Old_FlashMode = FlashMode
            GOSUB SetNavLtsFlashRates
        EndIF 
    
        x = (x + 1) // LEDcount
        PORTB.1(x) = !!(LoopLED(x) < OnTime(x))
        LoopLED(x) = (LoopLED(x) + 1) // (OnTime(x) + OffTime(x))
        #IFDEF USE_RANDOM_SEQUENCE
            IF x < 5 THEN
                RandPeriod(x) = RandPeriod(x) - 1
                IF RandPeriod(x) = 0 THEN
                    READ RandPeriods+(x<<1), WORD RandPeriod(x)
                    RANDOM RND
                    OnTime(x) = (MAX_ON - MIN_ON)* RND.HighByte / 255 + MIN_ON 
                    OffTime(x)= (MAX_OFF - MIN_OFF)* RND.LowByte / 255 + MIN_OFF
                ENDIF
            ENDIF
        #ENDIF
        IF x != (LEDcount - 1) THEN Main
    
    Waiting: IF !CCPIF THEN Waiting
        CCPIF = 0
    GOTO Main
    In this example, it's offset by 1 since PORTB.0 is the INT pin which is being used to detect a button push.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: How to Figure Out Compile Errors?

    Hi,
    Yes, the table shows the 16F690 having both an ECCP module and an USART. Unfortunately they won't leave you with unrestriced access to PortB.

    If, instead of doing the indexed bit operation ( PortB.1(x) etc ) on the PortB or any other Port, you do them on a BYTE variable (like myLEDS or whatever) you can then, as a final task in the loop take the value of that BYTE variable and split it across two ports. Write the four low bits to PortB.0-3 and the four high bits to PortC.0-3. Not saying that I'm sure it will work, Darrel may be using one of his tricks, but I think it might. Perhaps its worth a try.

    /Henrik.

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: How to Figure Out Compile Errors?

    I was going to use PORTC on the 16F690.

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: How to Figure Out Compile Errors?

    Hmm, then I'm not following, which doesn't really matter as long as you get what you need but in a previous post you wrote
    Can anyone think of another chip that has a CCP module, USART and 8 output pins on a PORTA/B/C which doesn't have the CCP/Rx pin?
    On the 16F690 the RX-pin is on PortB.5 and the CCP1 pin on PortC.5. I thought you were using those pins for their peripheral functions therfore not allowing 8 consecutive bits on either of those two ports - but I've must have misunderstood.

    /Henrik.

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: How to Figure Out Compile Errors?

    Sorry for not being clear, Henrik. For the current iteration of the code on a PIC16F88 I'm using PORTB.1-7 (since PORTB.0 is the INT pin which I have hooked up to a button switch) where the CCP1 pin is PORTB.3 but it doesn't matter as I'm only using the compare module, not the capture or PWM.

Similar Threads

  1. Replies: 10
    Last Post: - 11th April 2010, 09:12
  2. Usart compile errors 18F4520
    By Pedro Pinto in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 6th May 2009, 23:13
  3. USB PBPL Compile errors
    By Rob in forum USB
    Replies: 11
    Last Post: - 7th April 2008, 08:18
  4. USB Mpasm Compile errors
    By JBrannan in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 21st December 2007, 18:13
  5. Compile errors within macro....
    By forgie in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 5th September 2005, 19:08

Members who have read this thread : 0

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

Posting Permissions

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