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.

rhamer's Content

There have been 29 items by rhamer (Search limited from 04-June 23)


By content type

See this member's


Sort by                Order  

#22688 VB I2C zx-relay16 MCP23016

Posted by rhamer on 11 January 2012 - 03:57 AM in Visual Basic Support

I am having difficulty getting my Netduino Plus to communicate with a ZX-RELAY16 board that uses a MCP23016 interface chip. I have several points of ambiguity, and dont know exactly where my problem lies. I am running V4.2 I have the 2 boards connected as follows. SCL - Pin5 NetDuino SDA - Pin4 NetDuino GND - GND The ZX is powered through its own power supply and the Netduino Plus via USB My first problem is understanding how to code the I2C, as there seems to be the internal classes that I'm trying to use, that seems to be avoided by most, in favour of some other classes. Does anybody have a straight forward example of how to send a byte via I2C to a device register xx at device address yy In addition to that if anybody had an example of talking to the MCP23016 chip, that would be even better. Cheers Rohan



#22749 Can I2cBus Class be used with VB?

Posted by rhamer on 13 January 2012 - 06:01 AM in Visual Basic Support

Can I2cBus Class be used with VB? If so can someone list the steps. Cheers Rohan



#22811 I2C Bug in 4.2

Posted by rhamer on 15 January 2012 - 11:44 PM in Beta Firmware and Drivers

I have found what I believe to be a bug in the I2C code in V4.2

Im using a Netduino Plus and programming in VB.

This is the code;

Dim BytesSent As Integer

Dim con As I2CDevice.Configuration = New I2CDevice.Configuration(64 >> 1, 200)
Dim MyI2C As I2CDevice = New I2CDevice(con)

Dim data As Byte() = New Byte() {2, 255, 255}

Dim xActions As I2CDevice.I2CTransaction() = New I2CDevice.I2CTransaction() {I2CDevice.CreateWriteTransaction(data)}

BytesSent = MyI2C.Execute(xActions, 1000)

The problem is to do with the selected clock speed.

If I set the clock speed in the configuration line to 100 I get badly formatted data and that is probably because the clock is only actually running at about 95 Khz See first Attachment.

If I then change the clock to 150 I get correct data but 3 extra bytes are added to the end. See attachment 2.

Then if I use a clock speed of 200 or above I get the correct data as shown in attachment 3 and all works as expected.

I have also found that sometimes the Netduino fails to send anything at all, and I have to power cycle it to get it working again.

Can anybody explain this?

Regards

Rohan

Attached Thumbnails

  • screenshot100.jpg
  • screenshot150.jpg
  • screenshot200.jpg



#22851 I2C Bug in 4.2

Posted by rhamer on 17 January 2012 - 12:27 AM in Beta Firmware and Drivers

Is this the right place to report this? I would have thought something as important as this bug would have sparked some sort of response. Regards Rohan



#23256 Bug in system.net.sockets

Posted by rhamer on 24 January 2012 - 10:28 PM in Beta Firmware and Drivers

I have just encountered some strange behaviour with the socket.send() method in V4.2

using the following code, I get an exception thrown on every ninth byte.

    Public Function SendData(Data As Byte) As Boolean

        Dim ret As Boolean
        Dim DataByteArray() = {Data}

        Try
            clientSocket.Send(DataByteArray)
            ret = True
        Catch ex As Exception
            ret = False
        End Try

        Return ret

    End Function

This happens reliably every time.

The other odd thing is when I look at the data using wireshark, the data in the packets is always as follows.

1 data byte
7 data bytes
(exception thrown byte never sent)
1 data byte
7 data bytes
(exception thrown byte never sent)

this pattern continues until there is no more data to send.

If I catch the false return from the above method and just call the method again with the same byte, it works, so it is not the contents of the byte that is the problem (it is also different with every ninth byte not being the same data anyway)

Recalling the same method after an exception fixes the problem in as much as the byte is eventually sent, but it slows down the execution dramatically as you can imagine, and is not an acceptable workaround.

Can anybody think of something I might be doing wrong?

Regards

Rohan



#23264 Bug in system.net.sockets

Posted by rhamer on 25 January 2012 - 01:56 AM in Beta Firmware and Drivers

Just to clarify, you are sending a single byte with each call of "clientSocket.Send" ?

-Valkyrie-MT


Yes that is correct.

Regards

Rohan



#23269 Bug in system.net.sockets

Posted by rhamer on 25 January 2012 - 04:05 AM in Beta Firmware and Drivers

Further to my example above, I can confirm the following code example does not have the problem.

    Public Function SendDataArray(Data() As Byte) As Boolean

        Dim ret As Boolean

        Try
            clientSocket.Send(Data)
            ret = True
        Catch ex As Exception
            ret = False
        End Try

        Return ret

    End Function

The difference here is I'm passing a byte array into the method (instead of just a byte) which should make no difference at all, except the array contains more than 1 byte.

I can repeatedly call this method with no exceptions being generated.

Regards

Rohan



#23270 Are there timers on the Netduino Plus?

Posted by rhamer on 25 January 2012 - 04:10 AM in Netduino Plus 2 (and Netduino Plus 1)

What I mean is, are there timers that I can set an interval for, enable or disable, and have an event fire (and handled through an event handler) when the timer expires? Exactly like a timer gadget in the grown up .net If so can someone point me to an example. Regards Rohan



#23375 Are there timers on the Netduino Plus?

Posted by rhamer on 27 January 2012 - 09:36 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

Yes.

Here's a reference: http://wiki.tinyclr....le=SystemTimers

Dan


Thanks Dan, I'll take a look.

Cheers

Rohan



#24878 Multiple i2C Devices with VB

Posted by rhamer on 29 February 2012 - 10:49 PM in Visual Basic Support

Could either of you guys post some code with the LoveElectronics DLL as compiled by BainesBunch. I'm having a brain fade and cant get the syntax right. So far I have added a reference to the DLL, Imported LoveElectronics.Resources, but cant seem to get any further. Cheers Rohan



#25428 Netduino Firmware v4.2.0 RC4 (Netduino + Netduino Plus)

Posted by rhamer on 12 March 2012 - 10:45 PM in Beta Firmware and Drivers

Target for the next beta is 2-3 weeks from today. There will be a lot of updated code pulled into it.

Chris


Is any of it in the I2C area?

Unfortunately I am very close to having to abandon the Netduino Plus as the essential things I need (I2C & VB) are just not working properly yet.

Add to that the constant IDE crashes and the occasional Blue Screen when pressing the Netduino reset button during a download and I'm not making any progress at all, while my deadline grows nearer.

I really don't want to sound like a complainer, and I know this is only Beta firmware, but it has been in Beta for a while, and I cant see the roadmap or timeframe. is there one?

Regards

Rohan



#25443 Netduino Firmware v4.2.0 RC4 (Netduino + Netduino Plus)

Posted by rhamer on 13 March 2012 - 03:18 AM in Beta Firmware and Drivers

Hi Chris,

Thanks for the reply. I really dont want to be one of those whinging types.

The I2C bus is here http://forums.netdui...h__1#entry22811

I dont know about the beta drivers, I don't think so as I'm not sure where they fit into the environment. I just followed the instructions posted by another user and it didn't include anything for the IDE/PC end. What exactly are they for and how do I use them?

One more thing with regard to the I2C classes, is the inability to connect to more than 1 device. There seems to be some home brew classes to get around this, but nothing with clear instructions on how to use them. I see this as a huge deficiency in the I2C routines as the whole point is I2C is a bus. Having said that, if there is an official workaround (for VB) that you recommend I would be happy to use it.

BTW just so you know, the project I'm working on is a commercial application that will need 15 NetDuino Plus' to control various pieces of hardware, but it also needs to be rock solid. I hope things can be turned around soon as I only have a few more days before I will have to decide to stick with the ND or look somewhere else.

Thanks again for your help.

Regards

Rohan



#28989 VS2010 Crash on debug

Posted by rhamer on 14 May 2012 - 05:11 AM in Visual Basic Support

I have had this problem for some time now. The problem occurs with 4.2 RC 3,4 & 5 and is making development unworkable. Is there any known solution for this? I was hoping RC5 would fix it, but to no avail. My system is W7 x64, VS2010 and I'm using VB Any help would be greatly appreciated. Regards Rohan



#28991 VS2010 Crash on debug

Posted by rhamer on 14 May 2012 - 05:30 AM in Visual Basic Support

I was hoping I had a solution when I saw the new signed drivers. However after installing them, it makes no difference. If I set a breakpoint, then hover over a variable to read its value, instant crash, every time. This is unuseable. Regards Rohan



#29425 VS2010 Crash on debug

Posted by rhamer on 20 May 2012 - 04:32 AM in Visual Basic Support

Does anybody official have anything to say about this problem? Has it been recognised and is a fix being worked on? It seem like everytime I post here about a problem, it falls on deaf ears. Once again I would have thought a bug this big would have generated some sort of response..... I really want to be a Netduino evangalist, but stuff like this just makes it hard to keep the faith. Regards Rohan



#29549 VS2010 Crash on debug

Posted by rhamer on 22 May 2012 - 09:50 PM in Visual Basic Support

That was the first thing I did. I am running all the latest versions of everything. BTW the reason I'm so concerned about this, is I am trying to produce a commercial product with the Netduino as the controller, and time is tight. I don't have the luxury of being able to forget about it for a year and come back when it all has been fixed. Regards Rohan



#29561 VS2010 Crash on debug

Posted by rhamer on 23 May 2012 - 03:06 AM in Visual Basic Support

Yep that's exactly what happens for me. If the declaration is in the same file it is fine, but if it is in another file, then crash every time. I don't know about c# as I don't use it. Regards Rohan



#30409 Event handlers sample

Posted by rhamer on 08 June 2012 - 06:30 AM in Visual Basic Support

Has anybody come accross a problem where the events stop firing? I have an application that has an event tied to an input and after a while it stops firing. The way the event handler is written is exactly as shown in the example above, and it works properly for the first 10 or so pin level changes, then suddenly just stops firing. I have tried the sample program above, and the problem does not happen, so it is difficult for me to identify exactly what is the problem. Stripping down the application is not an easy task as it is quite a big complex application, and the latest thing added was the use of the events to monitor one of the digital inputs, which is actually driven by the interrupt pin of a MCP23017 port expander. When this problem occurs, the rest of the application keeps running fine, the event handler just never gets called. If I run a poll timer in the background that manually calles the same event handler after a few minutes, then all the code inside it runs correctly. I have also used a logic analyser to monitor the state of the pin, and it is actually being pulled low by the MCP23017 as it should. Regards Rohan



#30410 VS2010 Crash on debug

Posted by rhamer on 08 June 2012 - 06:40 AM in Visual Basic Support

Still nothing? No comment, no timeframe?



#30561 Event handlers sample

Posted by rhamer on 12 June 2012 - 12:17 AM in Visual Basic Support

Yes you were spot on, the event handler definition was in a thread that was going out of scope. It seems to be working ok now. Thanks for your help. Regards Rohan



#30651 Error Deploying Solution

Posted by rhamer on 14 June 2012 - 01:03 AM in Netduino Plus 2 (and Netduino Plus 1)

I just had this same problem, and the posted solution also fixed it for me. Is this likely to be a beta issue? Regards Rohan



#30679 When will V4.2 really be released and working?

Posted by rhamer on 14 June 2012 - 10:44 AM in Beta Firmware and Drivers

I know this is a loaded question, but is there really any actual date defined for the release of V4.2? I am having so much trouble with the current Beta, that I just cant imagine it being any time this year. Unfortunately I have only a few weeks left to finish my product, and I just can't afford the time I waste every day with deployment issues. it may be ok for a hobbiest, but for a comercial application like mine, it is costing far too much in lost time. I chose the Netduino against the wishes of my superiors, because I can see that it will be a fantastic platform one day. But right now I think I'll be retiring before I see that happen. Today I kept a record, and over 4 hours was wasted over the course of a day with deployment issues, that would constantly stop me in my tracks. I don't know what it is that triggers them, nor do I know the magic formula for getting it going again, but it involves everything up to and including rebooting the PC and manually erasing the Netduino. I just can't wait any longer, and I'm going to have to find another solution. My only hope is a positive response to this post, and a new much more stable version within a week. So what are the chances? Regards Rohan



#30703 When will V4.2 really be released and working?

Posted by rhamer on 14 June 2012 - 11:18 PM in Beta Firmware and Drivers

Well I feel a little better now that I have found some brothers that understand my pain. I really dont want to move away from the Netduino, but given these issues are obviously not just with my environment, I don't hold out much of a chance of me being able to fix them. I am however interested in the various solution that have been offered up, and perhaps between us we can figure out the magic formula to type, chant, drink or whatever actually works. Hell I'll even turn my whole desk to face east if that proves to be the key. I am going to start another thread where we can all share out little tips and tricks on solving the deployment issues we are all having. However I don't want this thread to end, I really want an answer from Secret Labs to my initial question, and some sort of acknowledgement that these problems are not just annoyances, they are show stoppingly huge and what is being done about them for real. Regards Rohan



#30704 Hints, Tips and Workarounds for Deployment Problems

Posted by rhamer on 15 June 2012 - 12:14 AM in Beta Firmware and Drivers

I have started this thread as a place to gather any wisdom regarding the dreaded deployment problems plaguing the Netduino. These problems are extremely frustrating, and so any ideas would be greatly appreciated. So, if you have discovered a way of bringing your Netduino back to life, or even better, stopping the problem all together, then please share it here. For the record I have tried typing "plugh" and "xyzzy" to no avail (one for the old timers) :-) My particular problems are the BSOD and failing to deploy. so far the only guaranteed solution is to do the following; 1 Cancel the deployment. 2 Unplug the USB. 3 Power down the project (my Netduino is a mounted as a sub board to a larger PCB that also powers it) 4 run mfdeploy 5 plug in USB 6 erase current programming (this is a few steps in mfdeploy) 7 if still not working, shutdown VS2010 (sometimes this gives BSOD) 8 if still not working reboot PC. Regards Rohan



#30711 Deploy and Debug via Ethernet, is it possible?

Posted by rhamer on 15 June 2012 - 03:35 AM in Netduino Plus 2 (and Netduino Plus 1)

I am wondering if it is possible to deploy and debug via the ethernet port rather than the USB? It appears from what I have read it is possible on some other manufacturers boards. Regards Rohan




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.