|
|
View previous topic :: View next topic |
Author |
Message |
Jerry I
Joined: 14 Sep 2003 Posts: 96 Location: Toronto, Ontario, Canada
|
use #pin_select problem (Solved Bummer) |
Posted: Sat May 09, 2020 6:51 pm |
|
|
Using PIC18F27K40, CCS PCH C Compiler, Version 5.078
I am having problem assigning peripherals using pin select option.
Pin select options from header file below
Code: |
////////////////////////////////////////////////////////////////// PIN_SELECT
// #pin_select function=pin
// Valid Pins:
// PIN_A0,PIN_A1,PIN_A2,PIN_A3,PIN_A4,PIN_A5,PIN_A6,PIN_A7,PIN_B0,PIN_B1,
// PIN_B2,PIN_B3,PIN_B4,PIN_B5,PIN_B6,PIN_B7,PIN_C0,PIN_C1,PIN_C2,PIN_C3,
// PIN_C4,PIN_C5,PIN_C6,PIN_C7,PIN_E3
// Input Functions:
// INT0,INT1,INT2,T0CK,T1CK,T1G,T3CK,T3G,T5CK,T5G,T2CK,T4CK,T6CK,ADACT,CCP1,
// CCP2,CWGIN,MDCARL,MDCARH,MDSRC,U1RX,U1CK,SCK1IN,SCL1IN,SDI1,SDA1IN,SS1IN,
// U2RX,U2CK,SCK2IN,SCL2IN,SDI2,SDA2IN,SS2IN,T0CKI,T1CKI,T3CKI,T5CKI,T2CKI,
// T4CKI,T6CKI,CCP1IN,CCP2IN,RX1,CK1,U1CKIN,RX2,CK2,U2CKIN
// Output Functions:
// NULL,CWG1OUTA,CWG1OUTB,CWG1OUTC,CWG1OUTD,CCP1OUT,CCP2OUT,PWM3OUT,PWM4OUT,
// U1TX,U1DT,U2TX,U2DT,C1OUT,C2OUT,SCK1OUT,SCL1OUT,SDO1,SDA1OUT,SCK2OUT,
// SCL2OUT,SDO2,SDA2OUT,T0OUT,CLKROUT,DSMOUT,ADGRDA,ADGRDB,PWM3,PWM4,TX1,DT1,
// TX2,DT2,SCK1,SCL1,SDA1,SCK2,SCL2,SDA2,TMR0OUT
|
Trying to assign 2 external clock counter inputs to these pins.
Code: |
#PIN_SELECT T3CK=PIN_B1
#PIN_SELECT T1CK=PIN_B2 |
error shown below on compile
*** Error 7 Line 108(12,24): Invalid Pre-Processor directive Invalid Pin: PIN_B2 can not be assigned to T1CK
Also tried #PIN_SELECT T1CK=PIN_B1 THIS DOES NOT WORK
Code: |
#PIN_SELECT T3CK=PIN_B1 // is fine
#PIN_SELECT T3CK=PIN_B2 // Also Fine |
It will let me assign to other pins on PORTA & PORTC
Can you only assign 1 peripheral to a PORT
Code: | #PIN_SELECT T1CK=PIN_A5 // Works
#PIN_SELECT T1CK=PIN_C1 // Works |
It appears to be a valid input for pin select option?.
Is this a compiler problem ??
Thanks for all the help.
Last edited by Jerry I on Sat May 09, 2020 7:49 pm; edited 1 time in total |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Jerry I
Joined: 14 Sep 2003 Posts: 96 Location: Toronto, Ontario, Canada
|
|
Posted: Sat May 09, 2020 7:52 pm |
|
|
Thanks for the info.
I should pay more attention to the datasheet. Bummer.
Thanks again. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19542
|
|
Posted: Sun May 10, 2020 2:04 am |
|
|
Yes, it's annoying isn't it....
It's a bit of the 'evolution' of PPS. The latest chips allow things to route
to any pin, while the older PPS chips have restrictions like this. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9244 Location: Greensville,Ontario
|
|
Posted: Sun May 10, 2020 4:13 am |
|
|
At least you don't have to wait 15 minutes waiting for the UV eraser to make your PIC 'just like new' again, an again , and again........ |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Tue May 12, 2020 10:48 pm |
|
|
temtronic wrote: | At least you don't have to wait 15 minutes waiting for the UV eraser to make your PIC 'just like new' again, an again , and again........ |
I remember those days.
I have some of those PICs sitting up behind me.
LoL.... those were the days. _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19542
|
|
Posted: Wed May 13, 2020 12:13 am |
|
|
Yes, and it was the fact that it took so long, that even if you had perhaps
six chips in use, and four chips in the eraser, you still found you had run out
and had to wait...
The launch of electrically erasable chips was a 'magic' day. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|