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.

Dave M.

Member Since 06 Jan 2011
Offline Last Active Jul 03 2013 09:50 PM
-----

Topics I've Started

SPI clocking in single shifting bit each time...

28 June 2013 - 04:52 PM

I've been having trouble interfacing with a device using SPI, and finally I decided to use my logic analyzer to monitor the data.  The chip has a NOP command, so basically I'm just calling SPI.WriteRead( new byte[1] {0}, new byte[1] {0}) in a tight loop to see what happens.

 

It looks like the first NOP goes out correctly, but each successive NOP actually clocks out a bit where it shouldn't be.  The additional bit looks like it shifts down each time, which makes no sense to me.  Can anyone provide me with ideas as to what could cause this sort of behavior?

 

I imagine that the data in the MISO column is just whatever the device is sending back in response to what command it *thinks* it's getting from the Netduino, so for now I'm concentrating on making sure that only zeroes get clocked out in my test app.

 

Here is my SPI configuration code:

SPI.Configuration l6470 = new SPI.Configuration( Pins.GPIO_PIN_D2, false, 0, 0, true, false, 1000, SPI_Devices.SPI1);SPI spi = new SPI( l6470);OutputPort standby = new OutputPort( Pins.GPIO_PIN_D3, true); // standby / rst is active low

Open source Amulet touchscreen project for Netduino

12 December 2012 - 10:07 PM

Hi everyone,

I've been looking for an excuse to use my Amulet touchscreen, and when the N+2 came out, I figured I'd work on it. I decided early on to make this a learning exercise for me with the Amulet, N+2, and git. I have a public project hosted on github that *should* make it really simple to interface with the touchscreen, as it deals with the protocol details for you.

If you want to see what the Amulet is all about, check out GEMstudio at their website. There's a free trial and it emulates the hardware so you don't actually have to spend any money.

No, I don't work for them. :) It's just a cool product that allows you to quickly get a nice UI on your embedded product without having to deal with drawing graphics and handling input events yourself.

Anyhow, hopefully this project is of use to someone out there in the Netduino community besides me. :) I welcome any feedback you might have to make the library better. It's not 100% complete, but what's there should be very useful for most projects.

Amulet.NETMF on Github

General rules for CLR / firmware compatibility?

30 November 2012 - 05:23 AM

I'm working on a project at both the office and at home. At the office I have a N+2, and at home I have a N+. My project works fine at the office, but when I checked out the code at home and tried to run it, the behavior was vastly different. In other words, it didn't work.

I figured that if I ran 4.2.x of the firmware on both, as well as 4.2.0.0 of the CLR, it should work. However, when I run my project at home, I immediately get an error like the following one in the output window:

Failed allocation for 24 blocks, 288 bytes

This usually prints over and over again. I read somewhere that it's technically not a fatal error, but what happens is that eventually the program crashes, and on a line in my code that doesn't make sense ( SerialPort.open() -- why would it fail when it's one of the first-constructed objects?). Other times, it runs, but extremely slowly and only occasionally seems to be able to pull bytes out of the serial buffer.

I was hoping that someone could enlighten me on this issue. Perhaps something from MFDEPLOY will make it really obvious what I'm doing wrong:

Work setup (working on N+2) -- output window messages + MFDEPLOY

Work

Create TS.

 Loading start at 806a238, end 8085f74

Assembly: mscorlib (4.2.0.0)

Assembly: Microsoft.SPOT.Native (4.2.0.0)

Assembly: Microsoft.SPOT.Hardware (4.2.0.0)

Assembly: Microsoft.SPOT.Net (4.2.0.0)

Assembly: System (4.2.0.0)

Assembly: Microsoft.SPOT.Hardware.SerialPort (4.2.0.0)

Assembly: Microsoft.SPOT.IO (4.2.0.0)

Assembly: System.IO (4.2.0.0)

Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1)

Assembly: Microsoft.SPOT.Hardware.Usb (4.2.0.0)

Assembly: SecretLabs.NETMF.Diagnostics (4.2.0.0)

Assembly: SecretLabs.NETMF.Hardware.Netduino (4.2.1.0)

Assembly: Microsoft.SPOT.Hardware.OneWire (4.2.0.0)

Assembly: Microsoft.SPOT.Time (4.2.0.0)

Loading Deployment Assemblies.

Attaching deployed file.

Assembly: AmuletLibrary (1.0.0.0)

Attaching deployed file.

Assembly: SecretLabs.NETMF.Hardware (4.2.0.0)

Resolving.

The debugging target runtime is loading the application assemblies and starting execution.
Ready.

The thread '<No Name>' (0x2) has exited with code 0 (0x0).



MFDeploy (work)

Pinging... TinyCLR
HalSystemInfo.halVersion:               4.2.0.0
HalSystemInfo.halVendorInfo:            Netduino Plus 2 (v4.2.1.0) by Secret Labs LLC
HalSystemInfo.oemCode:                  34
HalSystemInfo.modelCode:                177
HalSystemInfo.skuCode:                  4102
HalSystemInfo.moduleSerialNumber:       00000000000000000000000000000000
HalSystemInfo.systemSerialNumber:       0000000000000000
ClrInfo.clrVersion:                     4.2.0.0
ClrInfo.clrVendorInfo:                  Netduino Plus 2 (v4.2.1.0) by Secret Labs LLC
ClrInfo.targetFrameworkVersion:         4.2.0.0
SolutionReleaseInfo.solutionVersion:    4.2.1.0
SolutionReleaseInfo.solutionVendorInfo: Netduino Plus 2 (v4.2.1.0) by Secret Labs LLC
SoftwareVersion.BuildDate:              Nov  7 2012
SoftwareVersion.CompilerVersion:        410894
FloatingPoint:                          True
SourceLevelDebugging:                   True
ThreadCreateEx:                         True
LCD.Width:                              0
LCD.Height:                             0
LCD.BitsPerPixel:                       0
AppDomains:                             True
ExceptionFilters:                       True
IncrementalDeployment:                  True
SoftReboot:                             True
Profiling:                              False
ProfilingAllocations:                   False
ProfilingCalls:                         False
IsUnknown:                              False

Home setup (not working on N+):

Home

Found debugger!

Create TS.

 Loading start at 1542e0, end 16c5dc

   Assembly: mscorlib (4.2.0.0)

   Assembly: System (4.2.0.0)

   Assembly: Microsoft.SPOT.Hardware.SerialPort (4.2.0.0)

   Assembly: Microsoft.SPOT.IO (4.2.0.0)

   Assembly: System.IO (4.2.0.0)

   Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1)

   Assembly: SecretLabs.NETMF.Diagnostics (4.2.0.0)

Loading Deployment Assemblies.

Attaching deployed file.

   Assembly: SecretLabs.NETMF.Hardware.Netduino (4.2.1.0)

Attaching deployed file.

   Assembly: AmuletLibrary (1.0.0.0)

Attaching deployed file.

   Assembly: SecretLabs.NETMF.Hardware (4.2.0.0)

Resolving.

The debugging target runtime is loading the application assemblies and starting execution.
Ready.


MFDeploy (home)

Pinging... Pinging... Pinging... Failed allocation for 23 blocks, 276 bytes
TinyCLR
Pinging... TinyCLR
HalSystemInfo.halVersion:               4.2.0.0
HalSystemInfo.halVendorInfo:            Netduino Plus (v4.2.0.1) by Secret Labs LLC
HalSystemInfo.oemCode:                  255
HalSystemInfo.modelCode:                255
HalSystemInfo.skuCode:                  65535
HalSystemInfo.moduleSerialNumber:       

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
HalSystemInfo.systemSerialNumber:       FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
ClrInfo.clrVersion:                     4.2.0.0
ClrInfo.clrVendorInfo:                  Netduino Plus (v4.2.0.1) by Secret Labs LLC
ClrInfo.targetFrameworkVersion:         4.2.0.0
SolutionReleaseInfo.solutionVersion:    4.2.0.0
SolutionReleaseInfo.solutionVendorInfo: Netduino Plus (v4.2.0.1) by Secret Labs LLC
SoftwareVersion.BuildDate:              Sep 19 2012
SoftwareVersion.CompilerVersion:        410894
FloatingPoint:                          True
SourceLevelDebugging:                   True
ThreadCreateEx:                         True
LCD.Width:                              0
LCD.Height:                             0
LCD.BitsPerPixel:                       0
AppDomains:                             True
ExceptionFilters:                       True
IncrementalDeployment:                  True
SoftReboot:                             True
Profiling:                              False
ProfilingAllocations:                   False
ProfilingCalls:                         False
IsUnknown:                              False

Any help would be greatly appreciated! I would normally just shell out another $60 and not worry about it, but since my project is OSS, I'd like it to work on the Netduino/Plus/2.

Another weird experience, this time with the Plus 2

12 November 2012 - 02:23 AM

I decided to start working on a project and put my RS232 shield to good use. My first test was to just spit out "hello" on COM1. The code was pretty basic: I just created a SerialPort, opened it, and then used Write() to send the string in a tight loop. When I first ran the project, I had forgotten that it was set up to talk to the Netduino Plus, and not the Netduino Plus 2. Programming failed and the error message it had given me made sense (had something to do with not finding a Netduino Plus). I then changed to the Netduino Plus 2 and it downloaded the code fine, but then didn't seem to start running the project. Unfortunately, I didn't write down the error message and can't reproduce it. The upshot is that the code definitely got sent to the NP2 because upon reset, my terminal program showed my string getting blasted over the port continuously. However, now I can't reprogram the NP2 -- every time I plug it in, it just comes up as an Unknown Device. MFDEPLOY can't see it, either. I will probably resort to trying to reload the firmware after erasing via the erase pad, but I'd like to know how in the world what I did could have caused the NP2 to behave in this way.

Bricked my Netduino Plus?

11 November 2012 - 06:05 AM

So I received my Netduino Plus 2 today (yay!), and finally got a chance to hook it up. Now I know it's not exciting, but the first thing I wanted to do was see how fast it can blink the onboard LED. I measured a 75.2us period, which is great. From what I could recall, the Netduino Plus was somewhere around 60ms.

I wanted to hook up my Netduino Plus, so I had a brilliant idea to upgrade it to .NET MF 4.2 with the info on the following link: http://wiki.netduino...ep-by-step.ashx

I connected the pad to 3.3V, which apparently reset the Netduino somehow, because when I power cycled it, it came up in the Windows Device Manager as an Unknown Device. I tried to update its driver to no avail. I also followed the wiki page to try using the "GPS Connect" device driver, but that didn't work either. When I plug in the Netduino, I get the three fast low-pitch beeps.

Did I brick my Netduino Plus? Is there anything I can do to get it to update so I can switch between the Plus and Plus 2 easily?

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.