Also, haven't used it, but could try taking a look at:
http://forums.netdui...8-bitconverter/
Interesting. I can probably use some of that. I'm just a little nervous about the unsafe code not being official supported.
  | ||||||||||||||
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.
wjousts's ContentThere have been 22 items by wjousts (Search limited from 06-June 23) #17696 ushort to byte[]Posted by wjousts on 06 September 2011 - 07:34 PM in Netduino Plus 2 (and Netduino Plus 1)
Interesting. I can probably use some of that. I'm just a little nervous about the unsafe code not being official supported. #17694 ushort to byte[]Posted by wjousts on 06 September 2011 - 07:31 PM in Netduino Plus 2 (and Netduino Plus 1)
InsertValueIntoArray works, but it's the wrong endian for what I need. But I can fix that fairly easily. For double, parsing to a string won't work. I need the IEEE-754 representation. #17688 ushort to byte[]Posted by wjousts on 06 September 2011 - 06:51 PM in Netduino Plus 2 (and Netduino Plus 1)
Anybody know how to do the above? Convert a 16-bit integer to two bytes in the micro framework (and vice versa). In the full framework I'd just use BitConverter, but apparently that doesn't exist in the micro world. Also, I'm gonna need to convert 32-bit doubles to and from byte arrays.
#16157 Timing AccuracyPosted by wjousts on 01 August 2011 - 09:08 PM in Netduino 2 (and Netduino 1)
Thinking about this some more....
Initially I thought I could use resistors in series to program a 555 timer with the Netduino controlling which resistors are included in the series. I could have say 1K, 2K, 4K and 8K and by including various combinations of resistors I could have 15 different resistances giving 15 different pulse widths. My problem with this is that a simple switch (e.g. SCR, SCS or some type of transistor) wouldn't work. I need something equivalent to a SPDT switch because I need to bypass the unused resistors. So then I though it would be easier to use the capacitors in parallel instead. Same deal, 4 different capacitors giving 15 different total capacitance values. The problem here is finding capacitors with big enough values and tight enough tolerances. The capacitors with good tolerances have low capacitance which then would require a huge resistor to give a useful pulse width. Then I decided that this was all too complicated, and started look for something more integrated. I came across this: 82C54 CMOS Programmable Intervel Timer If I'm reading this correctly, this might do the job. I could use the Netduino to program the 82C54 and it will fire off a single pulse (in mode 1) at some multiple of the clock signal. I would just have to find an appropriate clock source (a crystal perhaps?). Any thoughts from the experts out there? #16180 Timing AccuracyPosted by wjousts on 02 August 2011 - 01:24 PM in Netduino 2 (and Netduino 1)
Thanks Mario. I just got my Netduino board and I'm going to start playing around with it. I agree with you that it makes sense to see how good (or bad) the timings are with just the Netduino board by itself before I start resorting to something external. I'll play around and see what happens. #16008 Timing AccuracyPosted by wjousts on 28 July 2011 - 06:19 PM in Netduino 2 (and Netduino 1)
I've only just now discovered Netduino and I'm wondering if it can do accurate timings?
What I need to do is create a device that can switch something on (a relay, for example) for a fixed period of time and turn it off again with good accuracy. The period might be as low as 10 ms. Prior to this I've used a relay board controlled via a serial port, but then all the timing has to be done on the PC side which isn't very reliable. The .NET timers won't do anything less than about 15 ms and are prone to being interrupted by whatever else the PC might be running. I was thinking about looking into learning how to program a microcontroller to do the job, but now looking a Netduino, it looks like it might be a much easier path using skills I already have (C# and .NET) instead of wading through using C or assembler and a bunch of mucking around with USB.
My idea would be to have a device where I can programmatically tell it (from the PC) that I want a 10 ms pulse. It will then turn on the appropriate digital output for 10 ms and turn it off again. The start time is less important than the duration and shouldn't be too much of a concern unless it's wildly inconsistent. Then I could tell it to do another pulse for, say, 30 ms, etc.
So, might a Netduino board do the job? Is it possible to get it to do accurate timings?
#16178 Timing AccuracyPosted by wjousts on 02 August 2011 - 12:49 PM in Netduino 2 (and Netduino 1)
Thanks for the input Mario. I figure a minimum pulse width of 10 ms, maybe 5 ms would be nice. Anything less than that is definitely overkill. Maximum pulse might be around 200 ms. As for error, the less the better (obviously), I think around 10 - 20% would be acceptable. Precision is probably more important than accuracy, so if it's consistently 1 ms too long on a 10 ms pulse (averaging to 11 ms), that's probably better than sometimes being 9 ms, sometimes 11 ms (averaging to 10 ms). The final application would involve, for a set of pulse widths (let's say 10, 20, 50, 100, 200 ms), generating in random order one of those pulses, then several seconds later generate another one, and so on until all pulse widths have been presented. The way I envision it, I would use an application running on the PC to order up the pulses as and when they are needed (the PC would also need to collect feedback after each pulse). The start of the pulse isn't as important as the width, so if the pulse doesn't start until 100 ms after the PC decides it needs it, it's not a problem. If it doesn't start until several seconds later, then it becomes a problem. Hope that makes at least some sense. Thanks again. #16149 Timing AccuracyPosted by wjousts on 01 August 2011 - 03:41 PM in Netduino 2 (and Netduino 1)
So, out of curiosity, how might you go about that? A 555 timer in monostable mode is controlled by the RC network attached to it. I would need to be able to vary the R and/or C in order to change the pulse width on the fly. I could imagine using the digital outputs of the Netduino as a switch to connect / disconnect several different RC networks to the 555 giving some number of pre-defined pulse widths, but is there a solution that could allow me to dial up any arbitrary pulse width? #17945 RS232 AdvicePosted by wjousts on 13 September 2011 - 07:50 PM in Netduino 2 (and Netduino 1)
To answer my own question, and in case anybody else needs them, I found this. #17014 RS232 AdvicePosted by wjousts on 24 August 2011 - 12:55 PM in Netduino 2 (and Netduino 1)
Thanks for the advice. I'll try and get hold of the shield you suggested (or similar). My device that I'm trying to connect to claims to be 5V for the serial communication, but I guess it probably still swings -ve, so maybe that's the problem. It's expecting the message from the Netduino to go negative and it doesn't. Still, shouldn't I be able to connect the Netduino pin 0 to pin 1 and make that board talk to itself? Just as a way to convince myself that the board is working and the right messages are getting sent? Needless to say, it ain't working. The values I'm getting back on port.Read aren't the same as what I sent out with port.Write. (edit: nevermind, it's working now) #17248 RS232 AdvicePosted by wjousts on 29 August 2011 - 06:46 PM in Netduino 2 (and Netduino 1)
Okay. Finally got it working. I bought this shield because I could buy it through Amazon and apparently emartee don't take credit cards, only paypal (no good with the corporate p-card). So everything seems to work, after messing around finding the right cross over cable I was able to send a command to my device and have it react. I haven't yet tried reading and interpreting the messages coming back yet, one step at a time. My only problem with the board I got is that it sits directly on top of the netduino. It blocks access to the onboard button, but I can live with that for now, but the real problem is that it clashes with power connector on the netduino board meaning that I can push it all the way down. Does anybody know a good source for some kind of spacer? #16991 RS232 AdvicePosted by wjousts on 23 August 2011 - 08:09 PM in Netduino 2 (and Netduino 1)
Hi all,
I want to connect my Netduino board to a piece of equipment that has an RS-232 port. What do I need to get started?
To be more specific, I'm only interested in connecting to the device, not to a PC and I'm not looking for a Serial to USB Convertor. The device I'm using has a 9 pin female connector and uses a minimal 3 wire serial port. I only need to connect the TxD, RxD and ground. I thought I might be able to do this directly from the board, but that doesn't seem to work (the device has a light that flashes if it doesn't understand the serial communication it's receiving, I had a very simple program running on the Netduino to send a known good command when the on-board button is pressed, but it doesn't seem that the device recognizes it). The device runs on 5V, so maybe that's part of the problem.
Any pointers or advice here would be greatly appreciated. I know I might need a shield, but I don't know which is the right one to get.
Thanks!
Edit: another related question. If I was to set up the Netduino to send a string of bytes on COM1, then I tied pin 1 back to pin 0, shouldn't I be able to read the exact same data back again?
#17275 RS232 AdvicePosted by wjousts on 30 August 2011 - 02:15 PM in Netduino 2 (and Netduino 1)
I could do that, but I do really like the compactness of having the boards stacked like that. It'll really make finding an enclosure to fit everything a lot easier when I'm eventually done with this project. #17018 RS232 AdvicePosted by wjousts on 24 August 2011 - 03:50 PM in Netduino 2 (and Netduino 1)
It's proprietary and so far it looks like it doesn't work, for whatever reason. #20316 Network configuration optionsPosted by wjousts on 07 November 2011 - 04:31 PM in Netduino Plus 2 (and Netduino Plus 1)
So looking at the NetworkInterface class, I have a couple of questions (the documentation on Microsoft's site isn't too informative). If I change the network settings during boot up, is it then necessary to force a reboot for the Netduino to pick up the changes (and if so, how do you do that). Second, if I use DHCP, is it necessary to do an explicit RenewDhcpLease? Third, the NetworkInterface class has an option for dynamic DNS, but in MFDeploy, I don't see an option for it. Is it actually supported by the Netduino, or should I just ignore it? And lastly, when configuring the NetworkInterface class, is there a specific order I should set things. For example, obviously if I check (from my config file) whether DHCP should be enabled, I can then skip IP address, gateway and subnet.
#20165 Network configuration optionsPosted by wjousts on 03 November 2011 - 03:09 PM in Netduino Plus 2 (and Netduino Plus 1)
Thanks for the feedback Chris. I realized afterwards that you can, in fact, just distribute MFDeploy, it's explained in the REDIST.TXT file which files you actually need and for now, I think that'll do. Of course, I still need my other user to install the Netduino drivers first, so that's a bit of a limitation. I think in the end, the easiest solution, the one that puts the least burden on the end user, would be to have a config file on the micro-SD card and have the Netduino read it in during it's boot sequence using the NetworkInterface class. This could then be easily changed by popping out the card, insert it in a regular PC and editing the file. The tricky part there, however, is that I can't now hide the whole device in an enclosure. I have to leave access to the micro-SD reader. #20058 Network configuration optionsPosted by wjousts on 01 November 2011 - 07:28 PM in Netduino Plus 2 (and Netduino Plus 1)
I have a netduino plus board that I need to send to an off-site colleague. The problem is that he'll need to reconfigure the network configuration on his side since I currently only have a static IP address assigned to my local subnet. What are the options for allowing an end user to change the network configuration?
As it is, I guess I could ask them to install the .NET CF just so they could use MFDeploy, but that seems a little overkill. Is there a simpler way? Is there a light-weight network configuration tool for a .NET MF device? If not, what would be involved in writing one? Alternatively, could I parse a file stored on a micro SD card on device start and have the Netduino configure itself that way?
Any ideas welcomed!
#17236 MFDeploy Hangs on Network ConfigurationPosted by wjousts on 29 August 2011 - 01:41 PM in Netduino Plus 2 (and Netduino Plus 1)
I just got the Netduino plus board and I opened up MFDeploy to try and configure the network. However, when I got to Target -> Configuration -> Network, the MFDeploy program just hangs and nothing happens. The on-board LED lights on the Netduino board and then goes out after a while, but the MFDeploy app fails to respond. Only when I disconnect the USB cable does it come up with an error message "Device had old or unsupported configuration". What gives?
#17239 MFDeploy Hangs on Network ConfigurationPosted by wjousts on 29 August 2011 - 03:17 PM in Netduino Plus 2 (and Netduino Plus 1)
It seems to work if I hold the button down. Thanks. #16184 Integrated Help files and documents?Posted by wjousts on 02 August 2011 - 02:13 PM in Visual Studio
I'm having the same problem. There's a bunch of stuff installed in a folder with the Micro Framework (Program Files\Microsoft .NET Micro Framework\v4.1\Documentation\NET MicroFramework Docs), but I have no idea how to view it. It's not integrated into the VS help files. And I don't see any documentation for the Netduino SDK.
#17729 Build Error 0xfd000000Posted by wjousts on 07 September 2011 - 05:35 PM in Visual Studio
Well stone me. That appears to have done it. Thanks. What a silly restriction and what an unhelpful error message! #17727 Build Error 0xfd000000Posted by wjousts on 07 September 2011 - 05:14 PM in Visual Studio
I keep getting this error whenever I try and build my project. The error code is all there is, there is no other information other than the "file" column which says MMP(?). Does anybody know what the problem here is?
| ||||||||||||||
|
||||||||||||||
This webpage is licensed under a Creative Commons Attribution-ShareAlike License. | ||||||||||||||