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.

RichardE's Content

There have been 13 items by RichardE (Search limited from 28-April 23)


By content type

See this member's

Sort by                Order  

#20188 Interfacing Gameduino to Netduino - SPI trouble

Posted by RichardE on 03 November 2011 - 09:57 PM in General Discussion

I've been playing around with a Gameduino attached to a Netduino and have had some success. If anyone is interested, see the attached files. There are three programs : 1. Character set editor and screen designer This is a Windows forms program which you can run on a PC (you will need .NET 4 installed) and allows you to design your own character sets and screen layouts and then export them as C++ source code (for Arduino) or C# (for Netduino). A bit ropey. No source code. If anyone gets stuck let me know. 2. Netduino program that plays a tune in a separate thread using 3 voices Full Visual Studio 2010 solution. 3. Netduino program that moves some sprites around Full Visual Studio 2010 solution. Funny glitch at the top left of the screen which I haven't sorted yet. Anyone who has played with an Arduino will recognise the sprites. The key to the Netduino examples is the Arduino class. Instantiate one of these as shown in the Program.cs files and then use its methods. Note that these examples are very slow. For reasons discussed above the SPI link is much slower than it would be on an Arduino. Would be much quicker using C++ and without .NET, but it works. Hope this is of some use and thanks for the help given above which was very useful in getting this to work.

Attached Files




#19884 Best way to do this?

Posted by RichardE on 27 October 2011 - 08:19 PM in Netduino Mini

I think you should normally put a resistor in place of the blue wire to limit the current. The way I think about it is that the maximum current that flows through the LEDs, the resistors and the transistor (from collector to emitter) will be the current that flows into the transistor base multiplied by the gain of the transistor. Normally the LED current is limited by the resistors in series with them. However, if you somehow got a short from the transistor collector to the 3.3V line then the transistor would try to pass a huge current and would probably expire. As a ballpark example, if you put a 4K7 resistor in place of the blue wire and the gain of the transistor is 100 then the base of the transistor will be sitting at around 0.6V (one diode drop) above the emitter, so 0.6V. When you take the output pin high then you will be dropping 3.3 - 0.6 = 2.7V across the resistor. Divide this by 4700 and you get roughly 0.6 mA. If you multiply this by the transistor gain of 100 then the maximum current the transistor will sink is 60 mA which should be enough to light 4 LEDs. Use a lower value resistor if you need more current, but don't draw more than 8mA from the output. If you don't fit the resistor you might get away with it because the Netduino simply won't supply the current but the hardware page states that you shouldn't draw more than 8 mA from an output so best to follow that suggestion. Did I miss something or won't all the LEDs come on at once? They are all connected to the same transistor so will come on together.



#19862 Best way to do this?

Posted by RichardE on 27 October 2011 - 11:20 AM in Netduino Mini

If you want to go the PWM IC route the Texas Instruments - TLC5940 looks like a good bet. This allows you to PWM up to 16 LEDs with up to 60 mA per LED but you will still only need 3 digital output pins however many LEDs you use. You can also daisy chain these devices if you need more LEDs. Will even run off 3.3V although you will probably want to use a separate supply for the LEDs if you are driving more than a few (not sure how much current you can draw from the 3.3V supply).

You can get these chips from Farnell (order code 1226306) in breadboard friendly DIL packages.

See link to TLC5940



#19815 Best way to do this?

Posted by RichardE on 26 October 2011 - 11:40 AM in Netduino Mini

How about something like this? (see attachment). Uses more pins but only one PWM output for each LED pair.

Attached Thumbnails

  • PWMLED.png



#19637 Exception in devenv.exe

Posted by RichardE on 23 October 2011 - 11:40 AM in Visual Studio

Is it just me or other people getting this sort of message? (see attachment) It doesn't happen every time, but enough to be annoying. What happens is that the project is deployed to the Netduino but about the time it starts to run I get this exception. Visual Studio is dead and gone after you click "No". However, the deployed program seems to carry on running just fine. Anything I can do about it? I am running on Windows XP SP3 on an elderly PC with only 512M of RAM. Running AVG Internet Security 2011 which normally seems to co-exist with Visual Studio OK.

Attached Thumbnails

  • Crash1.png



#19272 Deploying and Generics

Posted by RichardE on 16 October 2011 - 08:20 PM in Visual Studio

1. Out of interest, I see Visual Studio has "Deploy" and "Deploy Solution" options in the debug menu. When I use "Deploy" it downloads the assemblies to the Netduino, but it doesn't run anything. What's the point of this, and how do you then get it to run after downloading it? Do you always have to use "Start Debugging" (or F5) in which case the "Deploy" option seems a little pointless since F5 also does a Deploy? 2. What is "Deploy Solution" for? Does this allow you to download multiple projects from your solution to the Netduino? Again, wouldn't F5 do this? Also, just in case it helps anyone - don't even think about using generics (like I did). You just get a very cryptic error message of 8 hex digits. The .NET micro framework does not support generics. All I wanted to do was this: public class Point<CoordinateType>



#19253 AnalogInput.SetRange method

Posted by RichardE on 16 October 2011 - 02:24 PM in Netduino 2 (and Netduino 1)

I'm starting to play around with the analogue inputs but cannot figure out what the AnalogInput.SetRange method does. I looked at the tutorial for reading a temperature sensor, but the code does not use this method. The comments say that when you read the analog input you get 0 for 0V and 1024 for 3.3V (shouldn't that be 1023?). How does SetRange modify this behaviour? On a more general note - are there any documents describing the Netduino specific classes (such as AnalogInput)? I can find the Microsoft documentation but nothing on the stuff in the SecretLabs namespaces. Might need a book.



#19248 Where is TinyBooterDecompressor.bin?

Posted by RichardE on 16 October 2011 - 09:10 AM in Netduino 2 (and Netduino 1)

I have the "Microsoft .NET Micro Framework SDK 4.2 (RTM)" installed. In my project's properties I have target framework set to ".NET Micro Framework 4.2". I have installed netduinosdk_32bit.exe version 4.2. I am running Windows XP SP3 on an elderly PC with only 512 MB of RAM.



#19246 Hooking up Netduino to screen and serial

Posted by RichardE on 16 October 2011 - 08:29 AM in Netduino 2 (and Netduino 1)

I've been playing with a Gameduino shield connected to a Netduino. This allows you to connect a VGA monitor and stereo speakers (via an amplifier) and gives you a colour display with resolution of 400 x 300 pixels (although screen memory extends beyond the visible display to 512 x 512). It is a wonderful device but as others have said there are performance issues with the SPI link and you will have to do quite a lot of work to talk to it using C#. I was progressing quite well but now my Netduino won't talk to Visual Studio. Worth thinking about if you don't mind the effort. Alternatively (apologies if this is heresy) you could use it with an Arduino with the minimum of work.



#19245 Hooking up Netduino to screen and serial

Posted by RichardE on 16 October 2011 - 08:23 AM in Netduino 2 (and Netduino 1)

Hi Dave,

That RS232 shield is from CuteDigi and is compatible with both Netduino and Arduino. You should be good to go there.

The touchscreen attachment is not Arduino or Netduino compatible (without using a bunch of jumper wires). I'd recommend picking up one of the 4D Systems displays/shileds or other displays which have been tested with Arduino and Netduino.

Terry Massey and Omar have done lots of work with displays, as has Fabien Royer. Perhaps one of them can pitch in with recommendations?

Welcome to the Netduino community,

Chris




#19244 Where is TinyBooterDecompressor.bin?

Posted by RichardE on 16 October 2011 - 08:05 AM in Netduino 2 (and Netduino 1)

Visual Studio behaves differently with the device unplugged. Instead of the not in an initialised state message it simply says "Deploy failed" and the build output window shows "Device not found or cannot be opened - USB:Netduino". When I ping the device using MFDeploy I get "Pinging... TinyCLR" and when I run the "Show device info" plug-in I get: DeviceInfo: HAL build info: 4.2.0.0, Netduino (v4.2.0.0 RC1) by Secret Labs LLC OEM Product codes (vendor, model, SKU): 34, 177, 4096 Serial Numbers (module, system): 00000000000000000000000000000000 0000000000000000 Solution Build Info: 4.2.0.0, Netduino (v4.2.0.0 RC1) by Secret Labs LLC AppDomains: Assemblies: mscorlib,4.2.0.0 Microsoft.SPOT.Native,4.2.0.0 Microsoft.SPOT.Hardware,4.2.0.0 Microsoft.SPOT.Hardware.SerialPort,4.2.0.0 Microsoft.SPOT.IO,4.2.0.0 System.IO,4.2.0.0 Microsoft.SPOT.Hardware.Usb,4.2.0.0 SecretLabs.NETMF.Hardware,4.2.0.0 SecretLabs.NETMF.Diagnostics,4.2.0.0 SecretLabs.NETMF.IO,4.2.0.0 SecretLabs.NETMF.Hardware.Netduino,4.2.0.0 GameduinoTest2,1.0.0.0 I dare say I could erase the device, but won't that erase everything including the boot loader? Not sure I want to do that again unless all else fails.



#19230 Where is TinyBooterDecompressor.bin?

Posted by RichardE on 15 October 2011 - 10:43 PM in Netduino 2 (and Netduino 1)

Got a bit further on, but still not there yet. Found TinyBooterDecompressor.bin eventually and also ER_CONFIG and ER_FLASH and eventually managed to ping the device using MFDeploy. Can also see all the DLL files on the Netduino and they are all V4.2 so should be compatible. Only problem now is that I cannot get it to run. Visual Studio always hangs either at the deploying assemblies stage or just after with a message saying the debugger is not in an initialised state. No amount of rebuilding or unplugging and re-plugging seems to cure it. It looks like deploying might actually be working (since DLL files are all there) but I cannot get the debugger to go. Any thoughts?



#19224 Where is TinyBooterDecompressor.bin?

Posted by RichardE on 15 October 2011 - 08:17 PM in Netduino 2 (and Netduino 1)

Thought I would upgrade the .Net Micro Framework to V4.2. Big mistake. Got it all installed and Visual Studio recognised it. Code compiles but when it comes to deploying it it complains that it cannot have two copies of mscorlib with different versions on the Netduino and won't deploy. This is where I start getting confused. I followed the instructions on "Flashing new firmware step by step". I'm not even sure if I need to reflash the firmware, but using MFDeploy I was able to see all the assemblies on the Netduino, including the version of mscorlib and other .Net framework DLL files. I thought I might be able to just delete these DLL files from the Netduino but couldn't figure out how. I also have no idea where the ER_CONFIG and ER_FLASH files are but I'm probably getting ahead of myself. In the end I thought I would just erase the Netduino in the hope that the DLL files would be deleted but the bootloader would survive. Stupid. Everything went. Ho hum. Have to install a bootloader I suppose. So now following the "Installing the TinyBooterDecompressor step by step" instructions. Got SAM-BA tool. Got it to talk to Netduino. Ran the scripts "Boot from Flash (GPNVN2)" and then "Enable Flash access". Now looking for TinyBooterDecompressor.bin but have no idea where to find it. I did find a version for the Netduino Plus, but I have a standard Netduino. So can anyone point me in the direction of this file? Also, the ER_CONFIG and ER_FLASH files would be great. Thanks.




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.