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.

Kristoffer's Content

There have been 37 items by Kristoffer (Search limited from 28-April 23)


By content type

See this member's


Sort by                Order  

#28806 Using Go!Socket pin as IO pin

Posted by Kristoffer on 11 May 2012 - 10:13 AM in Netduino Go

Hi

Newbie alert!!!!

I've searched this forum and the Internet a lot (and I've probably read the answer, just didn't understand it)

I've worked with Netduino for a short time and driven stepper motors with the BigEasyDriver (BED), no problem. However I would like to use the Netduino Go for my project because of the modules.

But how do I connect my BED? Is it possible to connect it to one of the GO Sockets?

I know I can buy the ShieldBase and use it as a normal Netduino, but can I use GO Socket pin 3-9 as IO's, say, connect
GO Socket pin 3 to BED "dir",
GO Socket pin 4 to BED "step",
GO Socket pin 5 to BED "MS1"
and GO Socket pin 10 would go to BED "gnd"?

If possible, how would I reference the pins in C# code?

If it's unclear, I can provide a sketch of what I mean.

Am I way off?

Thanks
Kristoffer



#28854 Using Go!Socket pin as IO pin

Posted by Kristoffer on 11 May 2012 - 08:33 PM in Netduino Go

Thanks a lot for your replies, I'll look into it. Kristoffer



#29518 Robot 4x4 project

Posted by Kristoffer on 22 May 2012 - 12:37 PM in Project Showcase

Hi The videos are removed and can't be seen! Is it possible for you to upload the videos? I'm using the L298 driver as well for a dc motor, however I'm having some problems,,if possible, coild you provide a photograph of how you have connected the L298 to power supply (what supply are you using), Netduino, Jumper settings etc.? Regards Kristoffer



#29672 NetduinoGo ShieldBase.dll where

Posted by Kristoffer on 24 May 2012 - 01:24 PM in Netduino Go

Hi

I'm trying to get my NetduinoGo ShieldBase up and running.

I've downloaded and installed Netduino SDK v4.2.0

But I can't find the NetduinoGo.ShieldBase.dll I only got NetduinoGo.Button.dll, NetduinoGo.RgbLed.dll and NetduinoGo.Potentiometer.dll. What am I missing?

Am I supposed to download and build the ShieldBase firmware?

The examples I've seen with the ShieldBase doesn't say anything about building firmware, so I might suspect I'm making it more complicated than necessary.

Please enlighten me.

Regards
Kristoffer



#29697 NetduinoGo ShieldBase.dll where

Posted by Kristoffer on 24 May 2012 - 06:45 PM in Netduino Go

Thanks a lot Stefan, and thanks for updating the wiki as well. Kristoffer



#29754 NetduinoGo ShieldBase InterruptPort gives exception

Posted by Kristoffer on 25 May 2012 - 09:17 AM in Netduino Go

Hi

When I run this code

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoGo;

namespace ShieldBase
{
    public class Program
    {
        public static void Main()
        {
            NetduinoGo.ShieldBase sb = new NetduinoGo.ShieldBase(GoSockets.Socket5);

            Microsoft.SPOT.Hardware.InterruptPort ip = new InterruptPort(sb.Pins.GPIO_PIN_D7,
                                                                         true,
                                                                         Port.ResistorMode.PullUp,
                                                                         Port.InterruptMode.InterruptEdgeBoth);
            
            ip.OnInterrupt += new NativeEventHandler(ip_OnInterrupt);

            Thread.Sleep(Timeout.Infinite);
        }

        static void ip_OnInterrupt(uint data1, uint data2, DateTime time)
        {
            Debug.Print("ip_OnInterrupt()");
        }
    }
}

This statement gives an exception "An unhandled exception of type 'System.Exception' occurred in Microsoft.SPOT.Hardware.dll"

ip.OnInterrupt += new NativeEventHandler(ip_OnInterrupt);

The code (except for the ShieldBase) works perfect for the Netduino. Only other module attached to the NetduinoGo is a button at GoSocket1.

Project properties are:
Deployment – transport: USB
Deployment - Device: NetduinoGo_NetduinoGo.
Target framework is .NET Micro Framework 4.2

I've tried other pins with same result.

Any idea?

Thank you, Kristoffer



#29755 NetduinoGo Button - release event on button pressed

Posted by Kristoffer on 25 May 2012 - 10:39 AM in Netduino Go

Hi

Having this code

using System;
using System.Threading;
using Microsoft.SPOT;
using SecretLabs.NETMF.Hardware.NetduinoGo;

namespace GoConsole
{
    public class Program
    {
        public static void Main()
        {
            NetduinoGo.Button btn = new NetduinoGo.Button(GoSockets.Socket1);

            btn.ButtonPressed += new NetduinoGo.Button.ButtonEventHandler(btn_ButtonPressed);
            btn.ButtonReleased += new NetduinoGo.Button.ButtonEventHandler(btn_ButtonReleased);
            
            Thread.Sleep(Timeout.Infinite);
        }

        static void btn_ButtonReleased(object sender, bool buttonState)
        {
            Debug.Print(DateTime.Now.ToString("ss.fff") + " btn_ButtonReleased state: " + buttonState);
        }

        static void btn_ButtonPressed(object sender, bool buttonState)
        {
            Debug.Print(DateTime.Now.ToString("ss.fff") + " btn_ButtonPressed state: " + buttonState);
        }
    }
}

If I press the button and hold it down for a short time I get this output:

33.411 btn_ButtonPressed state: True
35.495 btn_ButtonReleased state: False

Just what I expected.

If I press it and immediately release it, the output often look like this:

41.911 btn_ButtonReleased state: False
41.912 btn_ButtonPressed state: True
42.001 btn_ButtonReleased state: False

or this

13.002 btn_ButtonReleased state: False
13.003 btn_ButtonReleased state: False
13.004 btn_ButtonPressed state: True
13.116 btn_ButtonReleased state: False

Occasionally this pattern also happens if I press and hold the button down.

47.208 btn_ButtonReleased state: False
47.209 btn_ButtonPressed state: True
52.804 btn_ButtonReleased state: False

My point is, sometimes I get one or two release events before the press event even though I haven't released it, is that digital bounce and as is and should I just handle it in code then?

Thank you
Kristoffer



#29806 NetduinoGo ShieldBase InterruptPort gives exception

Posted by Kristoffer on 26 May 2012 - 10:28 AM in Netduino Go

Ok, thanks.



#30229 Inductive sensor input problem

Posted by Kristoffer on 05 June 2012 - 01:03 PM in Netduino 2 (and Netduino 1)

Hi

I got an Inductive Proximity Sensor (https://www.mysick.c...ProductID=51476), which I'd like to read the output from with my Netduino.

It's a DC 3-wire PNP NO and I give it 24V.

See attachment for the setup.

The censor seems to work fine, when triggered it gives 24V in output and 0V when not triggered.

I've made a voltage divider which brings the sensor output down to ca. 4V and my multimeter confirms that.

But I can't read that value in Netduino, this little program outputs only "true"

public static void Main()
{
     var ip = new InputPort(Pins.GPIO_PIN_D1, true, Port.ResistorMode.PullUp);
     while (true)
     {
          Debug.Print("ip.Read() = " + ip.Read());
          Thread.Sleep(1000);
     }
}

I'm definitely not an electronic master mind, so any help with my setup is appreciated.

Thank you
Kristoffer

EDIT: attached file, sorry!

Attached Thumbnails

  • Inductive sensor Netduino setup.jpg



#30250 Inductive sensor input problem

Posted by Kristoffer on 05 June 2012 - 07:24 PM in Netduino 2 (and Netduino 1)

... If you want to read varying degrees of voltage you'll need to use one of the Analog IO Pins....

My goal is to receive a high signal so I give it 4.2V to a digital pin, that should be enough to give a high signal, as I understand the analog pins can only handle max. 3.3V input? So a digital pin and that voltage should be fine.

Changing to this
var ip = new InputPort(Pins.GPIO_PIN_D1, true, ResistorModes.Disabled);
gives me randomly true and false signals no matter what state the sensor is in :(

However, I noticed one thing, the voltage between the volt out of the voltage divider and the ground on the 24V power supply is 4.2V when sensor is triggered, but the voltage is only 2.8 between volt out of voltage divider and ground on Netduino, see attachment (Inductive sensor Netduino setup2.png)

So this is where I'm lost, what is ground? should I just try to turn up the output volt of the voltage divider to get +3.3V between Netduino Ground and input voltage (output voltage of voltage divider).

Kristoffer

Attached Thumbnails

  • Inductive sensor Netduino setup2.png



#30253 Inductive sensor input problem

Posted by Kristoffer on 05 June 2012 - 07:46 PM in Netduino 2 (and Netduino 1)

If I remember correctly, The Netduino will see anything higher than 1V as True and this might be where your trouble is

yes, that might be the problem, but how would I configure the Voltage provider? I've tried with a transistor without luck.

At the moment I'm trying to read up on transistors, they might help.



#30256 Inductive sensor input problem

Posted by Kristoffer on 05 June 2012 - 07:59 PM in Netduino 2 (and Netduino 1)

Connect the battery minus terminal with Netduino ground.

Bingo! :)


But why? I just don't get that ground thing, I think I must read more about basic electronics.

Thank you very much.



#30271 Inductive sensor input problem

Posted by Kristoffer on 05 June 2012 - 09:46 PM in Netduino 2 (and Netduino 1)

Ok, that makes sense, I've done this in other setups I've made out of examples, but this time I decided only to do something if I could explain it to myself. I learned something today :) , thanks again.



#30604 SPI.configuration and L6470 Stepper Driver

Posted by Kristoffer on 12 June 2012 - 09:13 PM in Netduino 2 (and Netduino 1)

Hi

I'm trying to connect to one of these: L6470 Stepper Motor Driver, a stepper motor driver controlled over an SPI link.

It comes with an Arduino example sketch, which runs fine. So I'm trying to port it to my Netduino using the SPI.Configuration and SPI types described in the wiki, so far no luck.

Below is an excerpt of the L6470 datasheet:

Maximum SPI clock frequency: 5 MHz
Chip select setup time: min. 350 ns
Chip select hold time: min. 10 ns
Deselect time: min. 800 ns
Data input setup time: min. 25 ns
Data input hold time: min. 20 ns

"When CS is high the device is unselected and the SDO line is inactive
(high-impedance).

The communication starts when CS is forced low. The CK line is used for synchronization of
data communication.
.....
After each byte transmission the CS input must be raised and be kept high for at least tdisCS
in order to allow the device to decode the received command and put into the shift register
the return value."


So I'm setting the SPI configuration like this:
opSS = new OutputPort(Pins.GPIO_PIN_D10, true);

var device1 = new SPI.Configuration(Pins.GPIO_NONE, // SS-pin
     				    false,          // SS-pin active state
                                    350,            // The setup time for the SS port.[b] What resolution is this?[/b]
                                    10,             // The hold time for the SS port. [b]What resolution is this?[/b]
                                    true,           // The idle state of the clock
                                    false,          // The sampling clock edge
                                    5000,           // The SPI clock rate in KHz
                                    SPI_Devices.SPI1// The used SPI bus (refers to a MOSI MISO and SCLK pinset)
                );

spi = new SPI(device1);
And the write routine:
static void SendBytes(byte[] bWrite, byte[] bRead)
{
    opSS.Write(false);
    spi.WriteRead(bWrite, bRead);
    opSS.Write(true);
}

But I'm not getting the same reponses as the Arduino example, far from.

If I i.e. send a0x38 byte via Arduino example, then I get a single byte back value 1. Doing the same from Netduino gives also 1, however, no matter how large I make the read buffer (i.e var bRead = new byte[40]; ) the first byte is 1 and the rest is 121 (decimal). And after that responses are not comparable.

Unfortunately I don't have an oscilloscope, so I can't measure what actually happens. Would that actually be possible to measure a byte with an oscilloscope?

I have tried to set SS port setup time and hold time in the SPI.Configuration constructor to 0 and it gives the same result.

If anybody can see anything that might cause trouble in my SPI setup, please let me know.

Thank you
Kristoffer



#30619 SPI.configuration and L6470 Stepper Driver

Posted by Kristoffer on 13 June 2012 - 05:15 AM in Netduino 2 (and Netduino 1)

You can just send a single byte at a time as that will toggle the CS line, however its not half as fast as it can be if you can get the CS line to toggle

Isn't that what I'm doing if I do like this:
{
var writebuffer = new byte[]{0x38};
var readbuffer = new byte[1];

SendBytes(writebuffer, readbuffer);
}



#30723 SPI.configuration and L6470 Stepper Driver

Posted by Kristoffer on 15 June 2012 - 08:44 AM in Netduino 2 (and Netduino 1)

Hi Nak

Thanks for all your help.

My first problem was that I couldn't send understandable commands to the L6470 driver via SPI, I solved this by changing the initial SPI.Configuration (see first post) to this:
var device1 = new SPI.Configuration(Pins.GPIO_PIN_D10, // SS-pin
                                    false,             // SS-pin active state
                                    0,                 // The setup time for the SS port
                                    0,                 // The hold time for the SS port
                                    false,             // The idle state of the clock
                                    true,              // The sampling clock edge
                                    5000,              // The SPI clock rate in KHz
                                    SPI_Devices.SPI1   // The used SPI bus (refers to a MOSI MISO and SCLK pinset)
                );
The problem was the Idle state of the clock and the sampling clock edge parameters, and it didn't make any difference if I toggled the SS-pin in code or it was automatically toggled when calling WriteRead(...).

This still doesn't give me the expected responses in the read buffer when I execute a spi.WriteRead(...);, but I've chosen not to be concerned about that at the moment. When the NetduinoGo ShieldBase is out of Beta all my code is going to be ported to the NetduinoGo, so I'll wait and see what new challenges lies ahead.

Im currently in the process of designing a 3 axis stepper motor driver module for the GO which uses the same dspin chip as your driver, does look like a very capable bit of kit

Indeed :), can I sign up for a newsletter or something? Please let me know when you expect to have something ready, I'm very eager to use the NeduinoGo.

I've been using the BigEasyDriver, which is very easy to get started with, but for my needs, I found it very difficult to configure and make proper acceleration/deceleration and the motors had this bzzz sound all the time.

Kristoffer



#31805 [nwazet Go! modules - update announcements

Posted by Kristoffer on 10 July 2012 - 08:59 AM in Netduino Go

...... Secret Labs needs to deliver the module flashing application that the Go! community needs.



Does anyone know if this is delivered or on it's way?

Thanks



#31807 [nwazet Go! modules - update announcements

Posted by Kristoffer on 10 July 2012 - 10:30 AM in Netduino Go

Does anyone know if this is delivered or on it's way?

Thanks


I guess this is it:
http://forums.netdui...-based-modules/



#32158 Shield Base Firmware v4.2.0.1 (beta 1)

Posted by Kristoffer on 17 July 2012 - 08:55 PM in Netduino Go

.....
Could you try flashing your Netduino Go with the attached (unofficial) firmware? Just flash all three files using ST's "DfuSe demonstrator" program.
....


Doing this solved my problem:

Running the ShieldBase firmware update stalled at line 180 in STM32Bootloader.cs

_bootloaderPort.Write(true);
And nothing happened until I forced the execution to stop.

I flashed the Netduino Go with the unoffical software and ran the ShieldBase firmware update again without any problems



#32195 ShieldBase unhandled exception on new OutputPort()

Posted by Kristoffer on 18 July 2012 - 12:55 PM in Netduino Go

I have reflashed my Netduino Go following the description in this thread:
http://forums.netdui...ployment-issue/

I have used the unofficial firmware chris links to at the bottom of this topic page 1
MainboardFlashUpdates.zip

After that I updated the ShieldBase with the beta 1 firmware found here: Shield Base Firmware v4.2.0.1 (beta 1) Includes PWM bugfixes

All went fine.

I can run the most simple NetduinoGo application without any problems

using System.Threading;

namespace GoTester
{
    public class Program
    {
        public static void Main()
        {
            Thread.Sleep(Timeout.Infinite);
        }
    }
}

See attachment debug_output_1_run.txt for debug ouput of this run

After that the problems start:

1. problem
When I try to rerun the program (stop debugging and run again or ctrl-shift-F5) I get this message: "Cannot find any entrypoint!" in the debug output window, see attachment debug_output_2_run.txt

I can get by this by unplugging the NetduinoGo USB cable from the computer and plug it in again and then run again. But that means I have to unplug and replug the USB cable each time I've made a new build.

2. problem
I reference the ShieldBase.dll and tries to instantiate an OutputPort but I get an exception (see also debug_output_shieldbase_run.txt)
A first chance exception of type 'System.Exception' occurred in NetduinoGo.ShieldBase.dll
An unhandled exception of type 'System.Exception' occurred in NetduinoGo.ShieldBase.dll

using System.Threading;
using Microsoft.SPOT.Hardware;
using NetduinoGo;
using SecretLabs.NETMF.Hardware.NetduinoGo;

namespace GoTester
{
    public class Program
    {
        public static void Main()
        {   
            ShieldBase sb = new ShieldBase(GoSockets.Socket5);

            OutputPort op = new OutputPort(sb.Pins.GPIO_PIN_D0, false);
            
            Thread.Sleep(Timeout.Infinite);
        }
    }
}

The StackTrace reveals it's in the ShieldBase.CreateOutport function it crashes (see StackTrace.png)

Have I missed something?

Attached Thumbnails

  • StackTrace.png

Attached Files




#32226 ShieldBase unhandled exception on new OutputPort()

Posted by Kristoffer on 18 July 2012 - 08:23 PM in Netduino Go

....If that is correct, please try to reflash the Shield Base again. If the update wasn't completely written (or accidentally restarted aftering being completed...and then got interrupted), your Shield Base firmware could be corrupt...which would cause this issue.


I believe that was part of the problem, did a reflash and now it works if I use shieldBase.Pins.GPIO_D2, but still same exception if I use D0 or D1, so problem 2 is partly solved:)

Problem 1 persists.



#32231 ShieldBase unhandled exception on new OutputPort()

Posted by Kristoffer on 18 July 2012 - 09:37 PM in Netduino Go

Unfortunately I'm not at my computer at the moment, I'll do it as fast as I can within a couple of hours. Appreciate all your help, thanks a lot :-)



#32241 ShieldBase unhandled exception on new OutputPort()

Posted by Kristoffer on 18 July 2012 - 11:33 PM in Netduino Go

Sample app to reproduce issue #1

using System.Threading;

namespace GoTester
{
    public class Program
    {
        public static void Main()
        {   
            Thread.Sleep(Timeout.Infinite);
        }
    }
}

And flash image attached

Attached Files




#32282 ShieldBase unhandled exception on new OutputPort()

Posted by Kristoffer on 19 July 2012 - 10:07 AM in Netduino Go

I've got the same issue when creating either an OutputPort or InputPort targeted at the ShieldBase. I haven't tried Analog yet....


Hi rcflyair

It looks as you have the same problems as I experience/experienced, I believe your post in this topic is also part of the problem.

One of the pitfalls for me in the update firmware process, was that I had to unplug and plug in again the NetduinoGo every time I had to deploy something new (because of the "cannot find entry point" issue). So after the ShieldBase firmware update, by routine, I just unplugged/plugged in the NetduinoGo, but that made the ShieldBase firmware update start all over and I didn't pay attention to that. So while the ShieldBase firmware update was in progress I uploaded a new program to the NetduinoGo trying to connect to a ShieldBase with incomplete firmware.

So after the ShieldBase firmware update I unplugged the NetduinoGo, unplugged the ShieldBase from the NetduinoGo, replugged the NetduinoGo and deployed a dummy program to the NetduinoGo. After that I could reattach the ShieldBase and I didn't have any problems initialising a new OutputPort.

I don't know if that's your problem, but it's worth a try.



#32287 ShieldBase unhandled exception on new OutputPort()

Posted by Kristoffer on 19 July 2012 - 11:28 AM in Netduino Go

Hi I did a little investigation this morning.

I created a new NetduinoGo application project in an empty solution in Visual Studio 2010 Ultimate

using System.Threading;

namespace GoTesting
{
    public class Program
    {
        public static void Main()
        {   
            Thread.Sleep(Timeout.Infinite);
        }
    }
}

I can run this project several (at least 10) times without having to unplug/replug the NetduinoGo USB cable to the computer, I put a breakpoint in the main method and it gets hit.
I can also put in and initialse a ShieldBase and OutputPort without any problems.

Then I add a second NetduinoGo application project to the solution, and add exactly the same code as first project.
using System.Threading;

namespace GoTesting2
{
    public class Program
    {
        public static void Main()
        {   
            Thread.Sleep(Timeout.Infinite);
        }
    }
}

I don't change the startup project and I don't unplug/replug USB cable

When I press F5 no breakpoint gets hit and it looks as it's trying to deploy GoTesting2 see 2_Projects_Debug_Output_1_run.txt. The dubug session is running and I have to stop it myself.

I try to unplug/replug USB cable, but still no breakpoint is hit, see 2_Projects_Debug_Output_2_run.txt

When I change the startup project to GoTesting2, all seems fine, GoTesting2 breakpoint gets hit and there's no problem when stopping and starting debugging several times.

When I change startup project back to GoTesting: same issue as first time GoTesting was startup project. When I remove GoTesting2, GoTesting is running fine again.

Hmmm! I actually tried this because I became insecure if I had upgraded the NetduinoGo firmware correctly, I believe that I had misunderstood the Upload/Upgrade groupboxes in the DfuSe demo app (thanks Stefan for explaining that you actually upload to your computer :) ), so I did a new NetduinoGo firmware upgrade just to be 100% certain. After that I wanted to reproduce Issue #1 "Cannot find any entrypoint!", but I couldn't, instead the above happened.

so I went back to one of my orginal projects containing a NetduinoGo Class library project and two NetduinoGo application projects, and the same pattern repeated: one of the application projects
couldn't run and the other could, actually it was the one that referenced the class library that could run.

So where does it bring now: I'm able to port my original Netduino project to the NetduinoGo at the current status, so I can move on.

However, I'm still very uncertain that my firmware upgrades are correct, I can't figure out if it's a Visual Studio, a Netduino SDK or a NETMF issue about the startup projects.

If I get some time I'll try to investigate this further.

So what I'm saying is I'll try to move on, with my fingers crossed. I'll report back later how it goes.

Thanks a lot for all your help

Kristoffer

Attached Files





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.