Netduino Firmware v4.1.1 ALPHA 7
#1
Posted 14 February 2011 - 07:29 AM
- attelmappopsy likes this
#2
Posted 14 February 2011 - 07:00 PM
#3
Posted 16 February 2011 - 09:29 PM
This LED-driver seems not to be the best choice in combination with the netduino. Anyway.. I will continue my search but keep up the good work!
Greetzz
#4
Posted 16 February 2011 - 09:51 PM
Variable bit-SPI is working fine. However I got some other problems with my LED_driver (timing of GSCLK) but noticed I was not the only one.
This LED-driver seems not to be the best choice in combination with the netduino. Anyway.. I will continue my search but keep up the good work!
Greetzz
Hi Benjamin,
Did the LED driver work with the v4.1.0.5 firmware (but not the new v4.1.0.6/v4.1.1alpha firmware)?
Also, what are the particulars of clock timing that are causing troubles?
Chris
#5
Posted 17 February 2011 - 03:42 PM
#6
Posted 17 February 2011 - 07:09 PM
this led-driver uses two kind of clocks. One is ment for the datatransmission (thus SPI-clk) and the other one for the PWM-timing. The SPI transfer which I use at 12-bit works fine. However this grayscale clock (GSCLK) is causing me a headache.
The problem with this is that the internal counter of the driver is using the grayscale clock as a trigger (for counting). When it reaches 4096 (12 bit) it does not reset automatically. This has to be done by activating(BLANK) exactly after 4096 GSCLK cycles. While blank is active, the outputs are off.
One of the other things is that new data can be shifted in during a "grayscale cycle" but only can be latched at the end of it. So this driver needs some specific timing and I think native code is a better solution at this point in time because of performance.
I have really tried to make it work (e.g. by using the PWM class for blank and gsclk) but for now I think I will look for another driver.
By the way, do you think there is another solution?
#7
Posted 17 February 2011 - 10:01 PM
What's the progress on the HID driver?
The .NET MF and desktop code is done, but we're still waiting on a bugfix to the .NET MF platform kit. Working on it...
Chris
#8
Posted 17 February 2011 - 10:03 PM
By the way, do you think there is another solution?
If there's no wiggle room for a little latency in resetting the counter, then a native code driver is probably the best option.
Chris
#9
Posted 07 March 2011 - 11:32 AM
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#10
Posted 07 March 2011 - 11:48 AM
Don't know if this thread is the right spot for this, but lets give it a try
With USB HID support, is it also possible to build in USB Storage support?
You could turn your Netduino into a USB Mass Storage device...yes. That wouldn't be using HID, and it might require native code, but I'm not aware of any limitations in the hardware that would preclude this. Fair warning: that could be quite a bit of work.
Chris
#11
Posted 07 March 2011 - 10:04 PM
StorageDevice.MountSD("SD", SPI.SPI_module.SPI1, Cpu.Pin.GPIO_Pin8); FileStream filestream; if (File.Exists(@"SD\game.log")) { filestream = new FileStream(@"SD\game.log", FileMode.Append, FileAccess.Write, FileShare.None); } else { filestream = new FileStream(@"SD\game.log", FileMode.Create, FileAccess.Write, FileShare.None); } StreamWriter streamWriter = new StreamWriter(filestream); streamWriter.WriteLine("HIT;Player" + player.ToString() + ";Team" + team.ToString()); streamWriter.Close(); filestream.Close(); StorageDevice.Unmount("SD");
This is all implemented in an EventHandler (SerialPortDataReceived), and i get an exception when the thread for that event is exited...
The thread '<No Name>' (0x2) has exited with code 0 (0x0).Step into: Stepping over non-user code System.IO.Ports.SerialPort.DataEventHandler #### Exception System.IO.IOException - CLR_E_FILE_IO (5) #### #### Message: #### Microsoft.SPOT.IO.VolumeInfo::.ctor [IP: 0000] #### #### Microsoft.SPOT.IO.RemovableMedia::MessageHandler [IP: 0022] #### A first chance exception of type 'System.IO.IOException' occurred in Microsoft.SPOT.IO.dll An unhandled exception of type 'System.IO.IOException' occurred in Microsoft.SPOT.IO.dll
Any ideas?
#12
Posted 08 March 2011 - 05:49 AM
#13
Posted 08 March 2011 - 07:23 AM
but its not finished yet or something, i've put thread.sleeps for 1 second behind the unmount method and between filestream and unmount but still i get the same exception.
It's a "real" exception, the program hangs:
An unhandled exception of type 'System.IO.IOException' occurred in Microsoft.SPOT.IO.dll
If i "break" i get the "No symbols available", because the exception is being thrown after the closing bracket of the eventhandler, so there's no real code visible on the break, and no dissasembly is visible
#14
Posted 08 March 2011 - 09:32 PM
#15
Posted 08 March 2011 - 10:24 PM
#16
Posted 09 March 2011 - 07:07 AM
#17
Posted 09 March 2011 - 06:39 PM
This is the simple program:
using System; using System.Text; using System.Threading; using System.IO; using System.Diagnostics; using System.Reflection; using System.IO.Ports; using Microsoft.SPOT; using Microsoft.SPOT.IO; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.IO; using SecretLabs.NETMF.Hardware.Netduino; namespace SDBugTest { public class Program { private static OutputPort _led1 = new OutputPort(Pins.ONBOARD_LED, false); private static InterruptPort _button = new InterruptPort(Pins.ONBOARD_SW1, true, Port.ResistorMode.PullUp,Port.InterruptMode.InterruptEdgeHigh); private static bool _enableLed = true; public static void Main() { _button.OnInterrupt += new NativeEventHandler(button_OnInterrupt); //This works, no problemo WriteToSD(); //Watchdog LED on the prototype board to keep the main thread alive while (true) { if (_enableLed) { _led1.Write(true); Thread.Sleep(500); _led1.Write(false); Thread.Sleep(500); } } } private static void button_OnInterrupt(uint data1, uint data2, DateTime time) { _enableLed = !_enableLed; //This seems to work only after the closing bracket "}", you get an exception WriteToSD(); } //An unhandled exception of type 'System.IO.IOException' occurred in Microsoft.SPOT.IO.dll private static void WriteToSD() { StorageDevice.MountSD("SD", SPI.SPI_module.SPI1, Cpu.Pin.GPIO_Pin8); FileStream filestream = new FileStream(@"\SD\game.log", FileMode.Append); StreamWriter streamWriter = new StreamWriter(filestream); streamWriter.WriteLine("TestingDate: " + DateTime.Now.ToString("HH:mm")); streamWriter.Close(); filestream.Close(); StorageDevice.Unmount("SD"); } } }
#18
Posted 12 March 2011 - 10:23 AM
The weirdest thing is though, that it doesn't break at a line, see this screenshot.
The thread '<No Name>' (0x2) has exited with code 0 (0x0).
#### Exception System.IO.IOException - CLR_E_FILE_IO (4) ####
#### Message:
#### Microsoft.SPOT.IO.VolumeInfo::.ctor [IP: 0000] ####
#### Microsoft.SPOT.IO.RemovableMedia::MessageHandler [IP: 0022] ####
A first chance exception of type 'System.IO.IOException' occurred in Microsoft.SPOT.IO.dll
An unhandled exception of type 'System.IO.IOException' occurred in Microsoft.SPOT.IO.dll
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#19
Posted 17 March 2011 - 09:36 AM
Thanks!
#20
Posted 17 March 2011 - 12:04 PM
Hi Dez,Chris, did you have any time trying to test the SD Card Bug Test project? I'm anxious to continue my project, but with this bug it's really not possible...
It's a really odd issue... I'll see if we can create a workaround while we're fixing the bug for the next beta.
I'll post back in this forum with updates.
Chris
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users