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.

franks's Content

There have been 3 items by franks (Search limited from 27-June 23)


By content type

See this member's

Sort by                Order  

#21877 Goodbye .NET MF?

Posted by franks on 19 December 2011 - 09:05 PM in Netduino 2 (and Netduino 1)

Hello Mario! At first let me say thanks for presenting your clear view of the netduino. I'm conform with resolving complex requirements in managed code and sourcing the simple stuff out. But I'm not really sure, if this is an economic way. Before adding a second unit for counting the pulses, I will try to write a driver. I found some tutorials in the net and I understand the technic. Just one question left. Why adding a driver to the firmware for doing this work is not the recommend way? Are there technical problems or is it 'just' against the philosophy of netduino? Best regards, Frank



#21826 Goodbye .NET MF?

Posted by franks on 18 December 2011 - 04:07 PM in Netduino 2 (and Netduino 1)

I found this High resolution light measurement thread with the same issue.

Running the sample code from site two I get the following output:

F = 400.84 Hz
F = 148.31 Hz
F = 862.31 Hz
F = 5264.22 Hz
F = 3.87 Hz
F = 1628.00 Hz
F = 1701.96 Hz
F = 1993.20 Hz
F = 6225.64 Hz
F = 5300.70 Hz
F = 1182.43 Hz
Failed allocation for 5 blocks, 60 bytes
Failed allocation for 5 blocks, 60 bytes

It goes up to 6 kHz with one InterruptPort on both edges. Will the measurement work, if I put the ISR in native code and call it via Interop?

Btw. Is the cpu speed set to maximum?

Best regards,

Frank



#21820 Goodbye .NET MF?

Posted by franks on 18 December 2011 - 12:34 PM in Netduino 2 (and Netduino 1)

Hello Netduino-Community!

Sad to say, am I going to get in trouble with a two channel 200 ppr code wheel rotary encoder. At the beginning everything works fine for me. But increasing the rotation speed the GC seems to be too slow for freeing memory.

I made a little sample program with these two functions (phase A and B with both edges):

private static int _steps = 0;
private void OnInputPhaseAInterrupt(uint data1, uint data2, DateTime time)
{
	_steps++;
}
private void OnInputPhaseBInterrupt(uint data1, uint data2, DateTime time)
{
	_steps++;
}

Turning the wheel slowly (about one rotation per second) works. Doubling the speed and the runtime will crash after about five rotations. :(

I changed the trigger to edge high to decrease the interrupts with the same effect. All tests are handmade, so I can't give you an accurate border.

With the .NET MF and SDK 4.1 I got an OuOfMemoryException. Upgrading to .NET MF and SDK 4.2 it changed to Failed allocation for 5 blocks, 60 bytes message.

With two interrupts on both edges we get 800 (2 x 400) interrupts per second. So we talking about 800 Hz. Increasing the speed to five rotations per second we obtain 4 kHz.

Is this really to fast for the .NET MF on a 48 MHz ARM7? And what are the options? Going back to c-compiled code and JTAG debugger?

Catastrophe! :blink:

Hope for a helping hand.


Best regards,

Frank




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.