Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

I²C connection with RFID - revisited


  • Please log in to reply
No replies to this topic

#1 FVN.Net

FVN.Net

    Member

  • Members
  • PipPip
  • 15 posts
  • LocationCentral Belgium, EU

Posted 05 October 2012 - 09:28 PM

Sorry dear forum members that I repeat my earlier question here in the N+ department.
The original posting of the problem is here:
http://forums.netdui...tion-with-rfid/

I know that this double posting isn't good practice but when browsing the VB.Net part of the forum, I noticed that the topic I²C came up in the dedicated VB pages 3 or 4 times over the past months with no answer at all or just a vague code snippet at best. So I take my chance again by posting it on the N+ pages, which seem to be read and replied to more.

VB support is what brought me to Netduino so I'd really like to get my project going. It's been over three days and numerous hours of trying to get something into /out of the SL030 RFID reader over I²C.

Here's my code:
Dim cfg As New I2CDevice.Configuration(80, 100)
Dim iic As New I2CDevice(cfg)

Dim outbytes() As Byte = New Byte() {}
Dim inbytes() As Byte = New Byte(7) {}

Dim i As Integer = 0
Dim sInput As String = ""

outbytes = New Byte() {80, 1, 1}

Dim write_transaction As I2CDevice.I2CTransaction = I2CDevice.CreateWriteTransaction(outbytes)
Dim read_transaction As I2CDevice.I2CTransaction = I2CDevice.CreateReadTransaction(inbytes)

Dim transActionList As I2CDevice.I2CTransaction() = New I2CDevice.I2CTransaction() {write_transaction, read_transaction}

i = iic.Execute(transActionList, 10)
Debug.Print(i.ToString)
Thread.Sleep(50)
For Each item As Byte In inbytes
   sInput &= item.ToString & " "
Next
Debug.Print(sInput)

This code tells me that 3 bytes have been sent as expected (outbytes array) and that nothing comes into the inbytes array since it all remain bytes set to zero by the declaration of the array.

Right now there are no external pull ups engaged, since WITH pull ups I get '1' for bytes sent and WITHOUT I get the expected 3 bytes sent.

I've searched everywhere and have tried numerous things. It drives me crazy.
I'd be really grateful if someone could help me out? Thanks a lot!
- Franki




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.