I2C Master/Slave examples. | Arduino Compatible Compiler for LabVIEW Discussions | Forum

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 4 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
I2C Master/Slave examples.
September 25, 2015
8:12 pm
Avatar
Jim.UF
Member
Forum Posts: 17
Member Since:
September 24, 2015
sp_UserOfflineSmall Offline

In the I2C Master/Slave examples:

The (Slave) serial monitor shows the Loop count incrementing by 2: 0, 2, 4, etc. A little debugging shows the Master is incrementing as expected (on each loop), but the serial stream from the Slave vi is skipping every other transmission. It appears every other interrupt is ‘missed’, as the serial monitor message rate is twice the loop rate of the master. 

What am I missing here?
Jim

September 25, 2015
8:25 pm
Avatar
Steffan
Admin
Forum Posts: 305
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Can you post your Master/Slave VIs?

September 25, 2015
9:02 pm
Avatar
Jim.UF
Member
Forum Posts: 17
Member Since:
September 24, 2015
sp_UserOfflineSmall Offline

It's I2C Master.vi and I2C Slave.vi shipped with the 1.0.0.18 examples.

September 25, 2015
9:07 pm
Avatar
Steffan
Admin
Forum Posts: 305
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Oh, ok.  I thought you had modified the example for showing the loop counter, but that is on the Master side.  Let me run it and see whats going on and I'll get back to you.

September 26, 2015
3:19 am
Avatar
Steffan
Admin
Forum Posts: 305
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Ok Jim.  Found the issue.  There is a small error on the I2C Master.vi example.  There should be a True constant wired to the "Send Stop" input of the I2C Write function (it has been left unwired).  If left unwired, the default will actually be false, and the bus will never be released until the start of the next transmission, hence is skips every other reception on the slave side.  Simply wire up a True constant as seen here:

I2C-Master.pngImage Enlarger

 

 

 

 

We will make sure to add this to the example in the next release.

Thanks for pointing this out.

Steffan

Attachments
September 28, 2015
7:51 pm
Avatar
Jim.UF
Member
Forum Posts: 17
Member Since:
September 24, 2015
sp_UserOfflineSmall Offline

Thanks Steffan, that did the trick!

Forum Timezone: UTC 0

Most Users Ever Online: 33

Currently Online:
1 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

John: 18

RTSLVU: 15

Dan6077: 11

Member Stats:

Guest Posters: 0

Members: 80

Moderators: 0

Admins: 3

Forum Stats:

Groups: 1

Forums: 2

Topics: 58

Posts: 289

Newest Members: Travlissah, viktorIcera, HowardClouG, Dianecet, Produktnaodchudzaniex

Administrators: geadmin: 5, filipealtoe: 35, Steffan: 89