hanzibal's Content - Netduino Forums - Page 14
   
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 28-September 23)


By content type

See this member's


Sort by                Order  

#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/




#51918 Exploiting the world of R/C hobby vehicles

Posted by hanzibal on 03 August 2013 - 07:20 PM in General Discussion

Hi all! During my vacation, I have visited two different archipelagos and by pure impulse, I found my self forced to purchase a radio controlled boat with a brushless electrical motor. The boat really runs and I can only say, I've been away from the R/C hobby field for too long. New battery types and motors make the electric boats run almost as petrol driven without all the fuzz. Anyway, I can think of a dozen cool things and improvements to be done using embedded electronics within the field of R/C boats alone. With respect to you knowledge in emebedded electronics, what have you guys done in terms of improvements and mods within this relatively unexploited area of hobbyism?



#50310 Power supply specifies minimum output voltage?

Posted by hanzibal on 06 June 2013 - 12:16 AM in General Discussion

1A minimum is really quite a lot, so much for current limiting ;-) Can that really be correct, one amp? I would hesitate using it for small signal electronics like with your typical Netduino project. When all works as intended in your project, there's no problem but if (when) you make a mistake like overloading or shortcircuiting, parts will burn to a crisp or literally blow up. Capacitors and LEDs can be harmful, shoooting debree in your eyes. Mine is also a switcher but minimum current is low, like only a few milli amps. It also has a minimum voltage of 1V but that hasn't been giving me any problems (yet).



#50657 Cheap + Good Cases / Enclosures - Continuing to Beat on this Topic

Posted by hanzibal on 20 June 2013 - 11:22 AM in General Discussion

These are very good value from $3,50

http://pcm63.com/?enclosures,88

But do ensure that they can deliver before ordering - I've placed a few orders there and some items where backordered for a pretty long time.

EDIT: What about Arduino enclosures? There are lots at eBay.



#50758 issues moving from 4.1 to 4.2

Posted by hanzibal on 24 June 2013 - 12:37 PM in Netduino Mini

The emulator showing up would indicate that you haven't actively set the deployment channel to USB (or COM port for the mini) but I would think you've already checked that?

 

Sometimes VS looses the setting and I'll have to goto project properties and put it back.




#51018 Mcp23s17 (SPI) with NP2+

Posted by hanzibal on 02 July 2013 - 02:01 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi, did you get this driver working eventually?




#51917 button push

Posted by hanzibal on 03 August 2013 - 07:08 PM in General Discussion

To think it took you a year to figure that out ;-) Just kidding of course and thanks for the tip of that chip that seems nice. Haven't looked through the d/s and in wonder, is it straight forward gpio driven (i.e set of switches) or does it have an I2C or SPI imterface? Either way (or especially in the latter case), could you post some code for it?



#50764 issues moving from 4.1 to 4.2

Posted by hanzibal on 24 June 2013 - 04:51 PM in Netduino Mini

I see. Usually when I accidentally run the emulator, I get an exception since it does not have the periphals I'm working with :-)



#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.



#51944 Exploiting the world of R/C hobby vehicles

Posted by hanzibal on 04 August 2013 - 08:34 PM in General Discussion

It actually runs quite well, at least before the batteries are exhausted which typically happens after only 5 minutes even with 2200mAh NiMh. I suppose the current is quite beefy at times, even the cables get warm and they're made to handle really large currents. Theoretically: 2.2 / 5 / 60 = 2.2 x 60 / 5 = 132 / 5 = 26.5 A That's in average, the speed controller is rated 90A. I've allready trashed two nylon propellers so I ordered an alu prop and rudder with the new 5200mAh LiPo pack currently on it's way from HK :-) Water cooling only activates when the motor gets hot, creating a slight pressure in the tubing and the water starts to flow. I'm probably getting a water cooling for the speed controller too and perhaps a micro pump so that cooling does not stop just because the boat does so.



#49417 Netduino plus 2 + Real time clock + RFID

Posted by hanzibal on 14 May 2013 - 10:18 AM in Netduino Plus 2 (and Netduino Plus 1)

Cool, seems I was wrong about the LCD - Good!



#49400 Netduino plus 2 + Real time clock + RFID

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

Hi! I don't know about the RFID reader but I think the Netduino does not have enough processing power to drve that LCD. Take a look at the Nokia 5110 instead, I know people on the forum have had success with that. About the RFID, what do you mean by "Real Time Clock RFID Sensor"? I'm asking since normally, RTC and RFID are not integrated but two different modules.



#56225 Own IO Shield

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

That Richard's pretty good :-)



#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.



#52501 Problem with SPI Mode 1

Posted by hanzibal on 02 September 2013 - 05:04 PM in Netduino Plus 2 (and Netduino Plus 1)

The clock seems to idle low in between transactions and I think that's what matters the most since the transitions are what drives the bus. Does clock idle low after the you have deasserted !cs? Does communication work with whatever device your trying to talk to?



#49998 Silly Voice Synth on NP2....

Posted by hanzibal on 26 May 2013 - 09:48 PM in Project Showcase

Yes, I believe it whould be very hard to modulate that in managed code.

 

If I'm not mistaken, you need about 10 times the freq of the highest note. With maybe ~8khz for the "ssss" sounds (?), you would need ~80kHz of PWM.

 

That is of course no problem in itself but you also need to be around to change the duty cycle every 125us and even if you manage that, there would be very little time left for other processing and I suppose there are quite some.

 

EDIT: Oh, and this is the song from your video. I find your robotic vocals slightly more rhythmic though  ^_^




#49976 Silly Voice Synth on NP2....

Posted by hanzibal on 26 May 2013 - 07:16 AM in Project Showcase

Sounds like my old A500 once did when fooling around with speech from within A-Basic. We used phonetics to try and make it speak swedish with some quite amusing results. Very interesting, I sure didn't know that RAM/ROM thing but just took for granted those where stored on flash and not read into ram until upon actually used. That knowledge would probably explain a thing or two that I've experienced when seen those "failed to allocate x blocks" debug outputs. Without having looked in the zip file (I'm on a tablet that can do unzip) nor checked the d/s of that vintaged speech synthesis chip of yours - what exactly are you using for playback? You mentioned a synth and by that, do you mean Netduino PWMs or some actual external h/w not seen in the video? Is there perhaps some kimd of schematics or wiring diagram inside the zip or could you just roughly describe how you wired this thing?



#50933 Ultrasonic sensor code.

Posted by hanzibal on 29 June 2013 - 02:58 PM in Netduino 2 (and Netduino 1)

Hi! Found a few things to be a little odd, I'm not sure they'll solve your problem though. You are creating the trigger port each time GetDist() is called. If you wish to share the same trigger pin among multiple class instances, declare the trigger port member as static instead and make sure it only gets created once. Create both the trigger and echo ports in your constructor and store them in private members. Remove the pin members since there's no point in remembering those any more. About interrupts, when adding an event handler, you are only registering a method to be called if and when an interrupt occurs. You are not, as your comment implies, waiting for it to happen at that point. This also means you should move event handler registration to the constructor as well. How are the the instances ultraSonic1 and ultraSonic2 created, what parameters are passed to the constructor?



#50498 what material is Smartwatch made up of?

Posted by hanzibal on 15 June 2013 - 05:22 PM in General Discussion

Kickstarter has a very low tolerance for antagonists. Having an account on kickstarter is a privilege.

That sentence pretty much summarizes what I disapprove of - the lack of balance. A crowd of yey-sayers can easily contribute in creating an unjustified hype over something that you are not allowed to be critical of. That's just does not seem right to me. How could it be a privildge to have an account, the account holders usually pay money, don't they? The priviledged ones ought to be the project owners. I can only imagine how much hard work it takes to get a project up there and reaching the monetary goals, but then again, it's not supposed to be easy either. Don't get me wrong now, I'm not against the Kickstarter concept in essence and also have nothing against the Agent smartwatch or any other Kickstarter project for that matter. It's the lack of balance I'm against. In fact, I really love the Kickstarter idea - it's a great way for people to get great products on the market using the common approval rather than that of a few capitalists and the kind of control they usually imply. There's so much great talent and potential out there and I think Kickstarter presents a fantastic opportunity for those to come into the open.



#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!



#49396 multi threading problem

Posted by hanzibal on 13 May 2013 - 06:57 PM in Visual Basic Support

Hi! Start by removing the do...loop in Sub Main, instead use Thread.Sleep(Timeout.Infinite). Next, both your threads will exit as soon as sensor and button reads true respectively. Once a thread exits its method, it stops running and won't get called again per se. Therefore, replace the "loop untill..." with just "loop" in each of the corresponding methods and it should work better. Better still would be for you to declare both sensor and button as Interrupt ports and then use the interrupt to turn motor rotation on and off depending the edge being high or low.



#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!



#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/




#50815 Anyone using WCF?

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

If you only want to send simple messages back and forth, you could always use sockets but perhaps that's a bit too simple plus you'd have to do any and all marshalling by yourself if you plan to transfer more complex structures. A web server doesn't have to be all that "full" either, you could just parse out the query string from the headers, perform the corresponding operation(s) and return a string like "OK" or whatever. I don't know if the HttpListener class et al is available but if so, it would make it very easy to implement a light weight web server. You could do many of the requests using AJAX and thus do the request/response parsing in client side javascript while displaying a fancy main page with the buttons and controls and what have you. Maybe throw in some JSON to get a little more structure in the server (device) responses. Now, I don't really know WCF or its benefits and maybe you have already considered the above.



#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/




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.