I downloaded the datasheet before ordering it, and it mentions the CCP1CON register - does that only apply to one of the other chips in the shared PIC16F631/677/685/687/689/690 data sheet?
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?
Hi,
If you look at page 2 of the datasheet you'll find the following table:
There you'll see that the 16F687 doesn't have the ECCP module. I'm not sure exactly what you're trying to do but if you want 8 outputs can't you split them across two ports? Say PortB.0-3 and PortC.0-3 of the 16F690 (same datasheet), RX is on PortB.4 and the CCP1 on PortC.5 so both of those are avoided.
Finally, in the code in your first post I don't see BLINKYFREQ being defined anywhere.
/Henrik.
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:
In this example, it's offset by 1 since PORTB.0 is the INT pin which is being used to detect a button push.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
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.
I was going to use PORTC on the 16F690.
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 wroteOn 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.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?
/Henrik.
Bookmarks