CW2's Content - Netduino Forums - Page 3
   
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.

CW2's Content

There have been 148 items by CW2 (Search limited from 29-April 23)


By content type

See this member's


Sort by                Order  

#59774 Netduino Plus 1 and Pins class

Posted by CW2 on 18 August 2014 - 08:44 PM in Netduino Plus 2 (and Netduino Plus 1)

So you can see Pins class in a new tab, and you can see this code!

 

Ok, thanks for the information. Well, the explanation is the code you see is not the actual source, but generated by Visual Studio via reflection - and obviously it is not quite correct, as the [mandatory] cast is missing. It could even be a 'feature', to make the definition easier to read by removing the obvious cast.




#59770 Small update from the .net MF team

Posted by CW2 on 18 August 2014 - 07:51 PM in General Discussion

Fingers crossed  :P




#59769 Visual Studio 2014

Posted by CW2 on 18 August 2014 - 07:25 PM in Visual Studio

I have not tried it myself (*), but it should be possible to compile .NET MF SDK for Visual Studio 2014 with appropriate modifications as described in Jan Ku?era's article (for 2013); although it might need a fix or two for Visual Studio SDK assembly references (due to some versioning issues).
 
(*) I decided to postpone my playing with certain .NET MF areas after Microsoft announced they were working on Visual Studio 2013 integration and that it will be released as VSX extension (the last post). I hope such extension will be [Visual Studio] version-independent.
 
Sal Ramirez said earlier today:
 

NETMF is still alive. As far as the Visual Studio integration, the team hit a couple of issues with code signing and the build environment. As soon as we resolve those issues we will post an update.

Thanks,

Sal




#59765 Netduino Plus 1 and Pins class

Posted by CW2 on 18 August 2014 - 07:01 PM in Netduino Plus 2 (and Netduino Plus 1)

public const Cpu.Pin ONBOARD_LED = 55;

 

Where exactly do you see this code? I cannot find it anywhere in the source. Are you inspecting the assembly (.dll) with some tool like .NET Reflector?




#59675 Powering the Netduino model 1

Posted by CW2 on 12 August 2014 - 06:18 AM in Netduino 2 (and Netduino 1)

Does the board have its own regulator for being powered between 7 and 9 volts via the barrel connector?

 
Yes, there is MC33269DT-5.0G linear regulator (datasheet pdf). It has typical dropout voltage ~1 V (max 1.35 V at 800 mA), which means you have to provide at least ~6.5 V input to have stable 5 V output. Absolute maximum input voltage is 20 V, the recommended ~7 - 12 V range is to minimize power losses - the higher input voltage the higher power has to be dissipated as heat.




#59622 Creating a custom board with Netduino firmware?

Posted by CW2 on 08 August 2014 - 08:44 PM in Netduino 2 (and Netduino 1)

Impressive. Hats off to doing it all in Fritzing.




#59621 High Resolution Quad Encoder Problem

Posted by CW2 on 08 August 2014 - 08:40 PM in General Discussion

I know nothing about that. So, cant use or comment on something I do not know about. Apparently it is a secret?

 

If you are referring to quadrature encoder inputs then no, it is not a secret. It is described in the STM32 datasheet, in fact many [modern] microcontrollers have such interface. For STM32F4 there is firmware with QuadratureEncoder class by NicolasG (for FEZ Cerberus, but it should not require too much work to port it over to Netduino gen 2).




#59616 High Resolution Quad Encoder Problem

Posted by CW2 on 08 August 2014 - 07:19 PM in General Discussion

... the Netduinos cant really depend on accurate timing.

 

They cant, but some of them (gen 2) have [hardware] timers with quadrature encoder inputs  :P




#59613 Slow I2C Sensor Reads, is this normal?

Posted by CW2 on 08 August 2014 - 07:07 PM in Netduino Plus 2 (and Netduino Plus 1)

Well, from the above the duration of I2C.Execute() method call is about 40 ms. Thus, even if you were able to consolidate the setup sequence into one I2C Execute() call, you'd still need at least three: setup, status check, data readout and that would be at least 3*40 = 120 ms, which is still 4× slower than Arduino.

 

IMHO the only way to get required speedup is to modify the firmware, i.e. create a native method that does all the I2C transactions to read data from the device.

 

Technical note: The .NET Micro Framework code is so slow in comparison to Arduino not only because it is interpreted, but also because there are several layers of abstraction - in this particular case, I2C methods take hundreds of instructions to execute parameter checking and marshalling, initializing internal structures, moving data forward and backward, mimicking asynchronous behavior using queues and completions etc. I can imagine writing a simple specialized I2C function that will not do anything but direct I2C calls, basically the same what Arduino code does - then it will be at least as fast, more likely faster (limited by I2C communication speed).




#59607 Slow I2C Sensor Reads, is this normal?

Posted by CW2 on 08 August 2014 - 02:45 PM in Netduino Plus 2 (and Netduino Plus 1)

Well, I guess you could save a few ticks by retrieving all the X/Y/Z data in one transation - the datasheet says "Multiple data bytes can be written or read to numerically sequential registers without the need of another START condition", so it should be possible to use
...
var data = new byte[6];
getReadings = new I2CDevice.I2CTransaction[]
{
  I2CDevice.CreateWriteTransaction(new byte[] { 0x00 }), // Start at 0x00
  I2CDevice.CreateReadTransaction(data) // Read 6 bytes
};
...
You could then have three class member arrays and copy each result at once (Array.Copy()), instead of 6 individual byte assignments. There are other minor optimizations that come in mind, but I am afraid there will not be major improvement - you'd probably need to measure how long each part of the code takes (e.g. duration of the Execution() method calls) to see, where is possible chance of improvement. You can use for example Stopwatch class, but keep in mind the resolution of system timer (~21 µs Netduino gen 1; 1 µs Netduino gen 2). Unfortunately, the interpreter has major performance impact.



#59602 Slow I2C Sensor Reads, is this normal?

Posted by CW2 on 07 August 2014 - 09:14 PM in Netduino Plus 2 (and Netduino Plus 1)

Ok, Spiked just beat me to it.  :)




#59601 Slow I2C Sensor Reads, is this normal?

Posted by CW2 on 07 August 2014 - 09:11 PM in Netduino Plus 2 (and Netduino Plus 1)

Unfortunately, there are certain areas in the .NET Micro Framework that should have been redesigned, e.g. to support multiple devices...
 
While it is not possible to create second instance of I2CDevice unless you Dispose() the first one, it is possible to have several I2CDevice.Configuration instances and switch among them:
 

// Warning: Code written from head

private I2CDevice.Configuration[] configs = new [] {
  new I2CDevice.Configuration(0x30, 400),
  new I2CDevice.Configuration(0x31, 400),
  new I2CDevice.Configuration(0x32, 400)
};

// Initialize with a dummy configuration, or use any of the above
private I2CDevice mag = new I2CDevice(new I2CDevice.Configuration(0, 0));

...
for(var i = 0; i < configs.Length; i++)
{
  mag.Config = configs[i]; // Select actual device
  runSensor(mag, i);
}

I think there is even a class/library somewhere in the forums... ...I2CBus and probably several  other 'multi' I2C implementations.




#59591 Convert PIC code to run on Netduino

Posted by CW2 on 06 August 2014 - 08:37 PM in General Discussion

This is going to be the speed controller for a robot's drive train.

 

If the main project objective is NOT building a motor controller, I would consider one of the many motor controller modules or specialized driver ICs... just for inspiration Pololu controllers...




#59589 Convert PIC code to run on Netduino

Posted by CW2 on 06 August 2014 - 08:14 PM in General Discussion

Why not use the PIC?

 

There are some issues with the current .NET Micro Framework implementation that limit its usage in such scenarios. I don't know exactly how the PIC drives the H-Bridge, but I can think of

 

1) Bit-banging - it depends on the frequency. Netduino's managed code is interpreted, i.e. slow. IIRC it can produce signal at 10 kHz range - I am not sure how fast you need to drive those power MOSFETs. Also, the code can be disturbed at any time, for example by garbage collector or interrupt handler, so the motor control will be stuck for relatively long time in certain state, which is not something you'd want. There are some techniques to minimize such events, but no guarantees.

 

2) Timers or PWM - there is missing the key feature: synchronized channels. The signals for left and right part of the H-Bridge must have precise relationship, they cannot overlap at certain moments etc. - usually, you configure two channels with opposite polarity, dead time and then start them at the same time. This would require firmware modification (the microcontroler has these features, but they are not accessible from managed code).

 

Personally, I would go with the PIC(s) - you've already got proven working (?) design, it is much better for real-time control, and also significantly cheaper. You can use Netduino to control them, if you must... ;)




#59561 Help with I2C

Posted by CW2 on 05 August 2014 - 11:48 AM in General Discussion

If I understand it correctly, the RTC works fine, but the LCD does not? You said the RTC has I2C pull-ups - do you use external pull-ups when the LCD is connected alone?

 

Have you checked the LCD module IC PCF8574 datasheet to verify the communication protocol is implemented correctly?

 

What is the LCD module supply voltage? In case of 5V, do you use level shifter to ensure proper logic levels from Netduino 3.3V outputs? PCF8574 logic high minimum voltage when powered by 5V supply is 0.7*VDD = 0.7*5V = 3.5V, so 3.3V is not enough (Arduino is 5V, so that would explain why it works).

 

...but have received ZERO replies, accordingly I am trying here.


It is not unusual to get a reply after a few days, especially when asked during a holiday season; and the probability gets lower for special hardware setups, too general and hard to troubleshoot issues ("it does not work"), without providing at least circuit schematic (photo of the actual wiring even better), the code etc. It's not the community does not want to help you, but there are just too many unknowns...




#59537 Assembly code

Posted by CW2 on 04 August 2014 - 06:08 AM in Visual Studio

Well, there is no assembly generated for the application - it is compiled [by .NET compiler, either C# or VB.NET] to assembly (.dll) which contains Common Intermediate Language (CIL), formerly called Microsoft Intermediate Language (MSIL). The current implementation of .NET Micro Framework does not have Just-In-Time compilation (that produces native assembly), the intermediate language code is interpreted.

 

You can use tools like ildasm.exe (part of the .NET Framework SDK, also installed with Visual Studio), .NET Reflector or any of its alternatives to view the contents of the .NET assembly, including the intermediate language disassembly.




#59528 Using Netduino to prototype & program a chip...

Posted by CW2 on 03 August 2014 - 12:27 PM in General Discussion

If I understand it correctly you want a custom board running Netduino firmware? Of course that is possible, as long as it is hardware compatible (e.g. clock frequency, inputs/outputs etc.). However, you'd need to have very good component source deals to make it cheaper (the microcontroller itself in single quantity costs significant part of the retail Netduino price, plus the other parts, PCB, assembly, testing etc.).




#59482 LCD panel from old 8.5" Philips TV (a085fw01 v7)

Posted by CW2 on 31 July 2014 - 06:36 AM in General Discussion

IMVHO it will be rather hard - as you can see in the datasheet, the LCD requires complex driving signals with precise timing (e.g. tCPH is 99 .. 107 ns) and multiple voltages (for an overview how to drive LCD with a microcontroller have a look for example at AN658). You'd also need some serious tools for troubleshooting, like oscilloscope and/or logic analyzer.

 

There are microcontrollers with dedicated (hardware) LCD drivers, e.g. STM32F427/37, which makes it a little bit easier, but still it is going to be a lot of work...

 

Much easier is to use the existing driver board from the TV and hope it has some usable interface. Almost certainly undocumented, so you'd need to decode the protocol...




#59469 Windows on Devices? When?

Posted by CW2 on 30 July 2014 - 03:49 PM in General Discussion

Good news is coming.....

 

  1. ... "soon"
  2. ... "likely in the next few weeks"
  3. ... "in the coming weeks and months"
  4. ... "in the future"

:P




#59431 Visual Studio 2013 official support yet?

Posted by CW2 on 29 July 2014 - 05:53 AM in Netduino Plus 2 (and Netduino Plus 1)

I think the most recent is comment by Sal Ramirez on the official .NET Micro Framework blog (posted on 7/11/2014):
 

Yes, we are working on Visual Studio 2013 support and we should have preview bits to release to the community soon, likely in the next few weeks.




#59417 IE support with this forum software - copy and paste doesn't work

Posted by CW2 on 27 July 2014 - 06:01 PM in Netduino Plus 2 (and Netduino Plus 1)

Internet Explorer 11 - Copy Paste issue

It seems to be a problem of the text editor the forum uses (CKEditor) - it was not IE11 compatible until version 4.3, which was released after IP.Board 3.4.6 (the actual version running the forum) shipped; it should be fixed in IP.Board 4.0.0.




#59395 Netduino Unique ID

Posted by CW2 on 25 July 2014 - 02:04 PM in Netduino 2 (and Netduino 1)

Yes, that's right - the EEPROM can be changed that way. There is no exact equivalent of the microcontroller Unique ID feature (which cannot be changed, because it is in ROM), so you'd have to use modified firmware.




#59394 Control 80V DC Motor/Bulb Using Netduino 2

Posted by CW2 on 25 July 2014 - 01:54 PM in General Discussion

There is one major problem with interfacing P-channel MOSFET to a microcontroller when switching [relatively high] voltage - when the control circuit closes, the switched voltage (i.e. 12, 60 or 80V) is applied to the microcontroller pin and it will be destroyed, because Netduino max pin voltage is less than 10V.

 

You have to use second N-channel MOSFET (or NPN BJT) placed between Netduino pin and P-channel MOSFET gate to control it. The proper circuit looks like this:

 

MOSFET_high_side_driver.png

 

You can replace Q3 + R3 with N-channel MOSFET (use R3 as pull-down, connected between gate and ground to ensure safe 'off' state).

 

I would recommend you to get a few different transistors and try low voltage (3.3V - 5V) circuits first, switching simple loads like LED and evaluate the possible configurations. After you understand how they work, you can 'upgrade' to higher voltage and current. Random messing with wires without understanding the basics is not going to end well...




#59389 Control 80V DC Motor/Bulb Using Netduino 2

Posted by CW2 on 25 July 2014 - 12:52 PM in General Discussion

Yes, if you want to control the positive wire, you'd need P-channel MOSFET. The control logic is inverted, low gate voltage is 'on', high gate voltage is 'off'; and there should be a "pull-up" resistor between gate and +V to ensure safe 'off' state.

 

Yes, N-channel MOSFET is cheaper than P-channel; N-channel is a little bit better (lower resistance, which means lower power losses, which means smaller heatsink : )




#59387 Netduino Unique ID

Posted by CW2 on 25 July 2014 - 12:13 PM in Netduino 2 (and Netduino 1)

Yes, MAC address can be changed.

 

The Netduino 2/Plus 2 microcontroller has unique ID feature, unfortunately it is not available in the current firmware, mostly due to privacy concerns (it has been already discussed several times on this forum). You can modify the firmware or you can use another device to store unique ID, such as EEPROM (small memory chip, interfaced from Netduino through SPI or I2C).





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.