hanzibal's Content - Netduino Forums - Page 15
   
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.

hanzibal's Content

There have been 386 items by hanzibal (Search limited from 02-July 24)


By content type

See this member's


Sort by                Order  

#50876 Compiling and downloading

Posted by hanzibal on 27 June 2013 - 03:27 PM in Visual Studio

Hello and welcome to the forum! You need Visual Studio 2010 or 2012, either the free Express version or any of the commercial ones. You also need the .NET Micro framework SDK and the Netduino SDK. Programming, debugging and deployment (firmware upload to the Netduino) is then performed from within Visual Studio by the click of a button. It's all a really simple and straight forward procedure so I guess that's why it is not often discussed explicitly. Don't worry, you'll be up and running very quickly. EDIT: You'll find all the required software for download on this page: http://netduino.com/downloads/



#50968 Compiling and downloading

Posted by hanzibal on 30 June 2013 - 08:14 PM in Visual Studio

Pleae note that the free version "Visual Studio Express" will work just fine for working with the Netduino. I recommend getting a Netduino Plus 2 as it is the most versatile with built-in networking and on-board SD card slot. Netduino mini is very small but not as powerful. Good luck!



#50071 PWM Constructor Trouble

Posted by hanzibal on 29 May 2013 - 06:27 AM in Netduino Plus 2 (and Netduino Plus 1)

Thats great, have fun!



#49964 PWM Constructor Trouble

Posted by hanzibal on 25 May 2013 - 06:22 PM in Netduino Plus 2 (and Netduino Plus 1)

Hello and welcome to the forum!

Yes, I believe you should use the PWMChannel enum as you suggested yourself, I also noticed this at some point and I think it was introduced with v4.2 of the framework. Take a look at the code attached for the lcd driver class in the below post and you should be able to see how to use PWM. I believe the file is named lcd1602.cs or something like that.

http://forums.netdui...-and-ir-remote/

Good luck!



#52116 Interrupts

Posted by hanzibal on 13 August 2013 - 10:21 AM in Netduino Plus 2 (and Netduino Plus 1)

The STM32F405xx datasheet says "Up to 140 I/O ports with interrupt capability" depending on package:

http://www.st.com/st.../DM00037051.pdf

 

They don't explicitly say that you can enable interrupts on all ports simultaneously and I strongly doubt you can.

 

The reference manual says the interrupt controller has 82 interrupt vectors:

http://www.st.com/we.../DM00031020.pdf

 

Since the interrupt vector table only has 82 entries of which many are used by peripherals, there's no way all GPIOs can be configured for external interrupts. This is confirmed in chapter 10.2.5 that says there are 16 external interrupts.

 

The NP2 has has a maximum of 22 GPIOs and it seems only any 16 of these can be used with interrupts.




#56225 Own IO Shield

Posted by hanzibal on 20 February 2014 - 10:26 AM in Project Showcase

That Richard's pretty good :-)



#56818 Help with line of code (var rowNumber)

Posted by hanzibal on 15 March 2014 - 03:43 PM in Netduino 2 (and Netduino 1)

When cascading as depicted on page 13 of the d/s, you don't send data to a certain chip, instead you just clock out the data bits in a series out the MOSI line and into the shift register of each chip. When all bits are in place, you assert the load pin for all chips at once and each chip will load whatever command there is sitting in its shift register at that point.

Of curiosity, how come you need more than 16 digits?



#56729 Help with line of code (var rowNumber)

Posted by hanzibal on 09 March 2014 - 08:23 PM in Netduino 2 (and Netduino 1)

Those are the values assigned by default so it won't change anything.

Actually, the MAX 7219 and 7221 are 8 digit driver chips but they support daisy-chaining while the driver class apparently does not.

https://www.sparkfun...219-MAX7221.pdf

The solution is to modify the driver so that it supports cascading.



#56613 Help with line of code (var rowNumber)

Posted by hanzibal on 04 March 2014 - 12:35 AM in Netduino 2 (and Netduino 1)

Judging from the RegisterAddressMap enum, there seem to be an 8 digit limit to the driver.

The enum is conceptionally mistreated. They way they are defined, they are not meant for you to apply arithmetics operations onto them.

Surely, as the corresponding enum values just so happens to be 0,1,2,3...etc because of the order in which they appear, you consecuently happen to get "digit1" by adding a one to "digit0". However, when adding a one to "digit7" you suddenly get "DecodeMode" instead of "digit8" which is not defined.

See what I mean?



#51320 Thinking Of Begining To Use Netduino

Posted by hanzibal on 10 July 2013 - 11:29 PM in General Discussion

I agree, a Netduino is not a good choise for those things and I don't even think the PI could cope. Any of those would probably be a really big detour from achieving what you want. As all of the bullets are pretty high level stuff, I'd recommend using a PC. Later, you could move to a micro or nano ATX if size is important. Of course, a Netduino could perhaps handle some of it but what's the point if you got s PC on the side. To be quite honest, I think the stuff you've mentioned taken together could take years to develop no matter what hardware you got.



#50859 Led.dispose() turns on led...why?

Posted by hanzibal on 27 June 2013 - 06:49 AM in General Discussion

It so happens that the pin you are claiming is electrically connected to an on-board LED. When disposing the pin, it reverts to its default config and usage. I'm not sure but, could it be the pin (and thus the LED) is used as a power indicator on your board?



#49384 Outputting to I/Os in parallel

Posted by hanzibal on 13 May 2013 - 02:10 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi!

 

I have some vague notion of reading somewhere that you could group pins together to form a parallel data bus on the version 2 boards but I can't find that info now and could be that was only a feature of the CPU itself and hasn't been made available to managed code yet. Perhaps someone can correct me on this?

 

So from what I know, the short answer would be no, I don't think there's any parallel bus.

 

...but - there are plenty of different solutions involving some external component. For example, with a shift register you can create a virtually parallel bus using SPI to drive it. You might want to look at the 74F166 which is an 8 bit bidirectional shift register:

 

http://www.nxp.com/d...heet/74F166.pdf

 

Also there's the PCF8574 8 bit quasi-bidirectional I2C I/O expander which is easy to use. Both of these ICs are available in breadboard friendly DIP16 packages.

 

For the latter, I've written a driver class and I2C bus manager that can be found in this post

http://forums.netdui...-and-ir-remote/




#49485 Outputting to I/Os in parallel

Posted by hanzibal on 16 May 2013 - 07:46 AM in Netduino Plus 2 (and Netduino Plus 1)

A really cool and useful feature of the PCF8574 8 bit I2C I/O Expander is that it is quasi-bidirectional meaning the pins work in both directions without the need for being configured in one direction or the other.

Also, I'm currently working on a driver class for the MCP23S17 which is a 16 bit I/O Expander with SPI interface. With my software, you can use it pin by pin or group pins together to form one or more parallel buses. This chip is also bidirectional and has excellent per pin interrupt handling. I'll be posting the code when done.



#56349 bitwise comparison & IF condition

Posted by hanzibal on 24 February 2014 - 09:45 PM in General Discussion

That makes it compile but it's not quite the same thing, I'd say it translates into this:
if ((this_led_color & mask) != 0)       SDI.Write(true);else       SDI.Write(false);
Checking for equality to mask is no longer the same when mask has other than a single bit set.



#50791 The latest thing: Oscilloscope Art

Posted by hanzibal on 25 June 2013 - 10:31 AM in General Discussion

I used an MCP41100 digital pot for drawing the signal and here's the code for it:

http://forums.netdui...-potentiometer/




#50370 The latest thing: Oscilloscope Art

Posted by hanzibal on 09 June 2013 - 01:31 PM in General Discussion

...and here's how I did it:

http://forums.netdui...-potentiometer/




#50361 The latest thing: Oscilloscope Art

Posted by hanzibal on 08 June 2013 - 10:04 PM in General Discussion

Can you see what the oscilloscope says?  :ph34r:

 

oscart_text.JPG

 

I'll be uploading some code later so we can compete in drawing the best oscilloscope art  :D

 




#49420 Old school ft. New school: Snake with a Lumia 920 controlling a 5110 LCD usin...

Posted by hanzibal on 14 May 2013 - 11:42 AM in Project Showcase

Very nice, at first I didn't see the Lumia but only an old 5110 but then I noticed the animated "fly by" arrows and reallzed the 5110 was never capable of that. Thanks for sharing! Edit: also, congrats on becoming a Nokia Developer Champion!



#56471 Lcd 16x4 initialization

Posted by hanzibal on 26 February 2014 - 10:33 PM in General Discussion

Faith, what controller is it, got a datasheet you can point to?



#50243 Static or Instance

Posted by hanzibal on 04 June 2013 - 09:30 AM in Netduino Plus 2 (and Netduino Plus 1)

I'm with NooM here, try and keep classes as self-contained as possible. Avoid scattering bits and pieces as statics in the main class. Gather and isolate things that belong together. In my opinon, the more globals, the worse the code in terms of clarity, change management, maintainance, porting, scalability, generalizantion, scalability, etc. Be aware of the limited amount of system resources, primarily RAM and processing power (your code is being interpreted at run time, there's no JIT here). Create late and destroy early. Be clever and figure out more efficient ways of doing calculations etc than you perhaps normally would. Optimize, use hash tables. Keep it short, lean and mean. Whenever possible, use event driven constructs (interrupts) rather than polling. Avoid tight loops as much as possible. Use multithreading concepts like producer/consumer relations between threads employing sempahores and mutexes. The scheduler does a really excellent job, sometimes almost magical. If you must do tight stuff, remember to yield once in a while in favor of other threads. Other than that, at least I don't take any particular explicit actions for memory management. In general, the GC normally does a better job when left in peace. Personally, I don't care much for IDispose. I mean, if you for example instanciate a driver class for an LCD, a switch or something like that - would you dispose of it run time? I know I wouldn't. Naturally, transient objects should be disposed of early, don't allow stuff to "build up" over time. EDIT: Of course, don't apply all of the above per sé but selectively when necessary, sensible and justified.



#52408 debug success but output doesn't showing

Posted by hanzibal on 28 August 2013 - 06:44 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi there and welcome to the Netduino forums. Debug messages should show but I suspect you debug output is direct to the immediate Window. Either switch to immediate window while debugging or change Visual Studio settings to direct debug message to the output window.




#51251 Webserver and locking

Posted by hanzibal on 09 July 2013 - 12:58 PM in Netduino Plus 2 (and Netduino Plus 1)

You should use an interlocked exchange to change the value of the _serverReady varible. The Interlocked.Exchange method will replace the value and return the previous value in a single atomic (unbreakable) operation.
int _serverReady = 1;if(Interlocked.Exchange(ref _serverReady, 0) == 1){            // process request       .      .      .      // done, open unlock the door      _serverReady = 1;}else{      // server busy}
As indicated above, I think you have to declare _serverReady as an integer for this work. You might want to use the volatile modifier on your variable declaration but I don't know if that feally matters in .NETMF. There might also be a way to configure the listener as synchronous so that the server will never attempt to process requests in parallel. Could be this feature is not available in .NETMF, I'm not sure.



#49461 New to this, I want to make sure I use the right tools

Posted by hanzibal on 15 May 2013 - 11:12 AM in General Discussion

Hi Dave and welcome to the forum,

I totally agree with Dave  :P

 

Seems like a good kit to start with. As you know the Netduino Plus 2 has networking capabilities and can send emails and such. As for sound, you can use PWM to play a chime on that piezo buzzer.

 

Since you're an experienced developer, I'm sure you'll manage to put the door bell/mailer together.

 

Good luck!




#50681 Mocking Inputs?

Posted by hanzibal on 20 June 2013 - 11:58 PM in General Discussion

Instead of Unit-testing, you might consider "black boxing" by writing a corresponding set of interfaces through which data Is introduced. You would then make your fake implementations always returning fixed or random dummy data as needed. Later of course, you would make real (non-fake) implementations.



#50553 How Many Motors can the Netduino Control?

Posted by hanzibal on 17 June 2013 - 03:29 PM in General Discussion

With the right controller, on, off, forward and backward (no speed control) would require 2 pins per motor. So depending on which Netduino you got, you could potentially control 8 to 11 motors and with an IO expander IC you could control many more.




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.