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 3 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
Members
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: 408
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
Members
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: 408
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: 408
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

sp_PlupAttachments Attachments
September 28, 2015
7:51 pm
Avatar
Jim.UF
Member
Members
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: 100
Currently Online:
28
Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
miche91: 33
scottj: 28
scadao: 23
Member Stats:
Guest Posters: 5
Members: 202
Moderators: 0
Admins: 3
Forum Stats:
Groups: 1
Forums: 2
Topics: 266
Posts: 1222
Newest Members:
pujacontrol
Administrators: geadmin: 22, filipealtoe: 96, Steffan: 356