KL27 I2c slave address recognition

cancel
Showing results for 
Search instead for 
Did you mean: 

KL27 I2c slave address recognition

Jump to solution
514 Views
neilhancock
Contributor IV

HI I'm creating an I2C Slave to a Beagle Bone Linux distribtution that emulates DS1374 RTC. The RTC supplies 32bit time, and 24bit alarm + status.

The Cape is designed to manage the BBB through power down and repower it on an alarm

Linux and BBB states it supports SMBus primarily (over I2C I think)

I started off with the FrdmKL27Za\fkl27z_rtos_examples_freertos_i2c demo and got it working, then expanded it to a ping-pong and ran it reliably for a day, and took a snapshot with a logic analyzer.

Then I switched to interfacing to the BBB and modifed the rtos_examples_freertos_i2c to respond on the basic cmds.

did the appropriate steps on the BBB

$sudo modprobe rtc-ds1374

$sudo /bin/bash -c "echo ds1374 0x68 > /sys/class/i2c-adapter/i2c-2/new_device"

 $  dmesg | grep ds1374

[ 3408.183413] rtc-ds1374: probe of 2-0068 failed with error -121

[ 3408.183667] i2c i2c-2: new_device: Instantiated device ds1374 at 0x68

To cut a long story to the essentials, On inspecting the logic anaylyzer and walking through the code

1) The kl27z was not responding with an ACK on the address

2) The demo code never actually utilizes the address match - it only utilizes the start and completion.

3) The FSL interface doesn't support SMBus even though its well documented in other areas of Freescale/Kinetis literature,

So my quick question - has anybody else got to use the I2C subsystem device mode interfacing to linux? 

At this point I'm switching to the FRDM-KL43 which specifies more closely matches my target 48QFP KL27Z128 with USB regulator.

Tags (3)
0 Kudos
1 Solution
284 Views
neilhancock
Contributor IV

Hi I found what my core problem was - noise on the wires between the BBB and the FRDM-KL27Z. I had some clip on leads that were about 6"

Once I tightly tied the gnd and the power bus through 1" cables and short wirewrap TWI leads the KL27Z started recognizing the address and acking it on the I2C bus. For all the _i2c demo software it doesn't use the address it just responds to start and stop conditions.

I do appreciate the i2c_demo software as it provides a starting driver, its just a bit frustrating that its soooo minimal for debugging real processors in the real world. 

View solution in original post

0 Kudos
1 Reply
285 Views
neilhancock
Contributor IV

Hi I found what my core problem was - noise on the wires between the BBB and the FRDM-KL27Z. I had some clip on leads that were about 6"

Once I tightly tied the gnd and the power bus through 1" cables and short wirewrap TWI leads the KL27Z started recognizing the address and acking it on the I2C bus. For all the _i2c demo software it doesn't use the address it just responds to start and stop conditions.

I do appreciate the i2c_demo software as it provides a starting driver, its just a bit frustrating that its soooo minimal for debugging real processors in the real world. 

View solution in original post

0 Kudos