View previous topic :: View next topic |
Author |
Message |
drh
Joined: 12 Jul 2004 Posts: 192 Location: Hemet, California USA
|
IDE error messages |
Posted: Fri Jul 16, 2021 2:57 pm |
|
|
Are you having trouble with I2C pin settings?
Pay attention to the error messages!
That's all I have to say. javascript:emoticon('') _________________ David |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Jul 16, 2021 5:01 pm |
|
|
Why don't you tell us what they are, so people who don't have the
IDE can learn something ? |
|
|
PrinceNai
Joined: 31 Oct 2016 Posts: 479 Location: Montenegro
|
|
|
dluu13
Joined: 28 Sep 2018 Posts: 395 Location: Toronto, ON
|
|
Posted: Mon Jul 19, 2021 7:21 am |
|
|
Taking a wild guess here: You need to use #pin_select |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9228 Location: Greensville,Ontario
|
|
Posted: Mon Jul 19, 2021 10:35 am |
|
|
I've never, ever had problems with I2C pin settings in 25 years, though maybe the OP is using a PIC other than the ones I've used ?? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19515
|
|
Posted: Mon Jul 19, 2021 10:53 am |
|
|
As diuu13 says, pin_select is an obvious one. Also the slew rate control can
rear it's head on some chips.
In all cases it is a critical to 'read the data sheet' situation.... |
|
|
drh
Joined: 12 Jul 2004 Posts: 192 Location: Hemet, California USA
|
|
Posted: Fri Jul 23, 2021 7:03 am |
|
|
It wasn't the pin select. I had not set up the clock source for the I2C module and left the TRIS for the two I2C pin as inputs. They need to be outputs. I ASSUMED that a module as complicated as this I2C would take control. I probably should have mentioned the chip: PIC18F47Q43. And this is the first time I have used the CCS IDE and ICD-80 although I've used the compler with MPLAB and MPLABX for years.
I was misled by the symbolic listing which showed confusing information.
The clock source problem was pointed out by Richard at CCS. And he also discovered the Symbolic listing did not match the CCS Basic listing. And did some testing of his own to verity the generated code.
Excellent customer support from Richard at CCS. _________________ David |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19515
|
|
Posted: Fri Jul 23, 2021 7:42 am |
|
|
This is very much a data sheet one.
The compiler will setup things for a fixed location peripheral, but when
the peripheral can be moved using PPS, there are so many things that need
to also change, that you have to do it.
Critical not in the data sheet:
Quote: |
Important: The pin locations for SDA and SCL are remappable through the
Peripheral Pin Select (PPS) registers. If new pin locations for SDA and SCL
are desired, user software must configure the INLVLx,SLRCONx, ODCONx,
and TRISx registers for each new pin location. The RxyI2C registers cannot
be used since they are dedicated to the default pin locations. Additionally,
the internal pull-ups for non-I2C pins are not strong enough to drive the
pins; therefore, external pull-up resistors must be used.
|
You are also using here the dedicated I2C module, not the more normal
MSSP module. This has a lot of extra settings that need to be made. |
|
|
|