CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

use #pin_select problem (Solved Bummer)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Jerry I



Joined: 14 Sep 2003
Posts: 96
Location: Toronto, Ontario, Canada

View user's profile Send private message

use #pin_select problem (Solved Bummer)
PostPosted: Sat May 09, 2020 6:51 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sat May 09, 2020 7:18 pm     Reply with quote

Get the 18F27K40 datasheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/PIC18LF27_47K40-Data-Sheet-40001844E.pdf
Look at this table on page 306:
Quote:
Table 17-1. PPS Input Selection Register Details

Find Timer1 clock in the left column and look over on the right and see
that it only works with ports A and C.
Jerry I



Joined: 14 Sep 2003
Posts: 96
Location: Toronto, Ontario, Canada

View user's profile Send private message

PostPosted: Sat May 09, 2020 7:52 pm     Reply with quote

Thanks for the info.

I should pay more attention to the datasheet. Bummer.

Thanks again.
Ttelmah



Joined: 11 Mar 2010
Posts: 19225

View user's profile Send private message

PostPosted: Sun May 10, 2020 2:04 am     Reply with quote

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. Sad
temtronic



Joined: 01 Jul 2010
Posts: 9113
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun May 10, 2020 4:13 am     Reply with quote

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........ Very Happy
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Tue May 12, 2020 10:48 pm     Reply with quote

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........ Very Happy


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: 19225

View user's profile Send private message

PostPosted: Wed May 13, 2020 12:13 am     Reply with quote

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. Smile
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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