chipKIT® Development Platform

Inspired by Arduino™

I²C Location on the MAX32

Created Mon, 29 Aug 2011 09:24:47 +0000 by Ddall


Ddall

Mon, 29 Aug 2011 09:24:47 +0000

Hello, I'm looking for the location of the I²C pins on my Chipkit MAX32 to use my ds1307 shield. I tried SDA: A4 SCL:A5 with no success (I tried a bunch of different pins with no success).

Where are them? Are they working like on the Arduino uno?


dc101

Mon, 29 Aug 2011 14:48:05 +0000

From the Max32 reference manual:

"I2C: Synchronous serial interface. Pin 21 (SCL), Pin 20 (SDA). This uses I2C1 (SDA1, SCL1) in the PIC32 microcontroller."

http://www.digilentinc.com/Data/Products/CHIPKIT-MAX32/chipKIT%20Max32_rm.pdf

Hello, I'm looking for the location of the I²C pins on my Chipkit MAX32 to use my ds1307 shield. I tried SDA: A4 SCL:A5 with no success (I tried a bunch of different pins with no success). Where are them? Are they working like on the Arduino uno?


Ddall

Mon, 29 Aug 2011 20:01:27 +0000

***It's working!!!!***I was missing the pull up resistors. Thanks I'm writing it down here so other n00bs can find this answer in one place.

In order to get I2C to work on Chipkit, you need to add 10k resistors pulling up to the +5v of the board on SCL and SDA (that's two resistors). Schematic here: http://www.robot-electronics.co.uk/acatalog/I2C_Tutorial.html

Arduinos have onboard pull ups resistors so that's why you don't need them over there.


GeneApperson

Mon, 29 Aug 2011 23:01:02 +0000

Arduinos have onboard pull ups resistors so that's why you don't need them over there.

Actually, Arduino boards don't have pull-up resistors on the boards. AVR microcontrollers have internal pull-ups that can be enabled when a pin is configured as an input pin. The ATmega328A data sheets specs these internal pull-ups as a minimum of 30K and maximum of 60K ohm. The ATmega168 data sheet says min of 20K, max of 50K ohm.

The correct size of pull-up resistor to use is a function of total distributed capacitance on the bus and maximum desired operating frequency. The distributed bus capacitance and the pull-up resistor form a low pass filter that limits the rise time of the signals, limiting the operating frequency.

10K ohm is reasonable for a short bus with not very many devices on it. I generally use 2.2K, which allows a longer bus with more devices on it.

Gene Apperson Digilent


GeneApperson

Mon, 29 Aug 2011 23:03:05 +0000

One of the reasons that I didn't put pull-up resistors on the boards is, since the PIC32 is a 3.3V device, some applications would want the pull-up to 3.3V and some would want the pull-up to 5V.

Mixed voltages on the I2C bus don't work well.

Gene Apperson Diiglent


scottharris

Mon, 17 Oct 2011 00:07:44 +0000

What did you do to get I2C working on the Max32? I can't get anything out of the I2C port on this board.

Thanks, -Scott

***It's working!!!!***I was missing the pull up resistors. Thanks I'm writing it down here so other n00bs can find this answer in one place. In order to get I2C to work on Chipkit, you need to add 10k resistors pulling up to the +5v of the board on SCL and SDA (that's two resistors). Schematic here: http://www.robot-electronics.co.uk/acatalog/I2C_Tutorial.html Arduinos have onboard pull ups resistors so that's why you don't need them over there.


Darrell

Sun, 05 Feb 2012 21:59:04 +0000

I finally figured out how to read the Microchip TCN75A ChipKIT BASIC IO Temperature Sensor from the Max32 board.

My biggest problem was trying to trace out the signals used on the different ChipKIT Max32, Basic IO, and Network Shield as the same signal jumps around on different connector pins and documentation references. I am using all three in a stack, with the Max32 on the botton, the Network Shiled in the middle (Kapton tape on top of the Ethernet jack to prevent shorting), and the Basic IO on the top.

I wish the common stacking connectors could have all used the same reference designator, and a more uniform labeling scheme. For, the SDA2 line for the three boards from the schematic pages:

IOH - J3 pin 11; Silk 13; SDA2/RA3 (Max 32) IOH - J8 pin 11; <no extra pin description>; SDA2 (Network Shield) IOH - J1 pin 11; chipKIT PIN # 13; SCK/RG6 (Basic IO)

Too bad all three connectors wern't labeled something like:

IOH - J21 pin 11

I am still not sure what the ChipKIT PIN # is, except to guess it is an internal Digilent numbering scheme, as these pin numbers do not seem to line up with the actual Pic32 Pinouts.

Anyway, the TCN75A (schematic sceet 4) shares SDA1/SCL1 with the 24LC256 and J11 header (schematic sceet 3).

The Max32 header J4 carries SDA1 (silkscreen SDA/pin20) and SCL1 (silkscreen SCL/pin21). The silkscreen J of J4 is hiding under the edge of the connector.

The Network Shield J16 carries SDA1 (silkscreen pin20) and SCL1 (silkscreen pin21).

To follow the instructions from the IOShield Libraries Readme.pdf for:

"Users of the Max32 board should note that to use devices that require the Wire library they must connect the SCL (pin 20) and SDA (pin 21) pins on the Max32 to the SDA and SCL pins on J11 of the Basic IO."

For me this means:

  1. Installing a jumper from either of the Basic-IO J11 SDA pins (both SDA row pins on J11 are connected together per the schematic) to the Network Shield J16 pin 20.

  2. Installing a jumper from either of the Basic-IO J11 SCL pins (both SCL row pins on J11 are connected together per the schematic) to the Network Shield J16 pin 21.

If you are only using Basioc IO Shield with the Max32, this would become:

  1. Installing a jumper from either of the Basic-IO J11 SDA pins (both SDA row pins on J11 are connected together per the schematic) to the Max32 J4 pin SDA 20.

  2. Installing a jumper from either of the Basic-IO J11 SCL pins (both SCL row pins on J11 are connected together per the schematic) to the Max32 J4 pin SCL 21.


GeneApperson

Thu, 09 Feb 2012 18:12:49 +0000

I am still not sure what the ChipKIT PIN # is, except to guess it is an internal Digilent numbering scheme, as these pin numbers do not seem to line up with the actual Pic32 Pinouts.

The chipKIT pin # is the digital pin number that you would use for digitalRead or digitalWrite.

The schematic of the Basic IO Shield shows the pin numbers for the shield plugged into an Uno32.

The problem is, that since the Arduino people saw no need to attempt any kind of pin numbering commonality with the smaller boards when they designed the Mega, the pin numbering between the Uno32 and the Max32 is inconsistent. They follow the conventions of the Uno and Mega boards.

Sorry that it is so confusing to trace these things down across the boards. I'll see what I can do to clean that up a bit.

Gene Apperson Digilent


knChip

Fri, 10 Feb 2012 19:10:34 +0000

Hi, Arduino UNO usess Analog4 and Analog 5 for I2C communication. As far as I know, the DS1307 RTC libraries were written using them. Will it still work for chipKIT-Max32 if we connect to SDA - > Analog 4 SCL -> Anlog 5 and use the standard libraries which is available with MPIDE or we have to use the I2C pins 20 and 21 ? If we use the hardware I2C of the chip which library to be used? are there any examples available? Thanks, Narayanan


Jermcb

Sun, 09 Sep 2012 19:47:33 +0000

I know this is an older thread, but I can't seem to get my basic I/O shield working with my max32 board.

I am using the example code given by digilent for both the EEprom and the temp sensor. Neither work. I have tried connecting the SDA and SCL lines from JP11 to JP2 & 3. I have tried this while shorting out the pins on JP2 & 3 to enable the pull up resistors, and without shorting the pins on JP2 & 3.

For the temp sensor, I keep getting a reading of 0.

What am I missing?

Thank you to anyone who can help...


Jermcb

Mon, 10 Sep 2012 00:10:22 +0000

Still not working,

I have a Uno32 board aswell. I used the I/O shield with the Uno32 and used both the Temp sensor example and EEprom example provided with the I/O shield.

No luck on both accounts. So the examples don't work with both the Max32 and Uno32 boards?

I did not change anything on I/O shield when using it with the Uno32. I left the jumpers on at JP2 & 3...

Thanks in advance...


JordanR

Tue, 11 Sep 2012 22:00:11 +0000

Hello Jermcb,

Take a look at this post:

http://www.chipkit.org/forum/viewtopic.php?f=18&t=1449

The picture I uploaded has a Max32 + Network Shield + Basic IO Shield, but the idea is the same. Physically connect Pins 20 and 21 (on the Max32) to A4 and A5 (on the Basic IO Shield). You should be able to get data through (ie, you shouldn't get 0 C or 32 F for the temperatures).

Make sure you are following both these notes (From the comments at the top of the IOShield_Temp_Demo sketch):

/* Note: For chipKit Max users you must manually ** connect SDA and SCL pins(20 and 21) to pins A4 and A5 of ** IO Shield ** ** Note: For chipKit Uno Users you must have Jumpers JP6 and JP8 ** set in the RG3 and RG2 positions

Best Regards,

Jordan R Digilent


Jermcb

Tue, 11 Sep 2012 23:12:19 +0000

To Jordan R

Thank you very much!

To anyone who reads this thread and is looking for the solution: Click on the link supplied in the response by Jordan R above and download his zip file of images in the 4th post in that thread. It has the images of how to do this...

Thanks again!