j2inet's Content - Netduino Forums
   
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.

j2inet's Content

There have been 11 items by j2inet (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#48350 Bricked Netduino Plus. Help needed

Posted by j2inet on 13 April 2013 - 01:09 PM in Netduino Plus 2 (and Netduino Plus 1)

The gold pin doesn't do anything on the Netduino Plus. To do the firmware update you need to hold down the reset button before connecting it to the computer, plug in the USB, then release the button. The procedures for the rest of the firmware update are pinned at the top of these forums. 




#48122 [Netduino Plus] Driver not found on Windows 8

Posted by j2inet on 06 April 2013 - 06:13 PM in Netduino Plus 2 (and Netduino Plus 1)

Try setting the driver path to "C:Program Files (x86)Secret LabsNetduino SDKDrivers" and make sure you check the option that tells it to search subdirectories too. 




#47951 Unable to reset Netduino

Posted by j2inet on 03 April 2013 - 01:58 AM in Netduino Plus 2 (and Netduino Plus 1)

I have 4 Netduino Plus 2 units and I've repeated this on three of them (I'm afraid to try it on my last one). 

 

In stepping through a program the only thing that executes is the first line of the program, which is the following:

 

var controlPort = new SerialPort(SerialPorts.COM1, 38400, Parity.None,8,StopBits.One);

 

 

After that execution never returns and I can no longer use the device at all. Attempting to deploy from Visual Studio 2012 results in the error "Unable to communicate with device USB:Netduino"

 

The output to the deployment process follows. 

 

Looking for a device on transport 'USB'Starting device deployment...Iteration 0Opening port ?USB#VID_22B1&PID_1000#000000000000#{09343630-a794-10ef-334f-82ea332c49f3}OperationsAttaching debugger engine...... cannot attach debugger engine!

 

MFDeploy doesn't seem to be able to do much either. If I select "Connect" from the menu I do get back the positive response "Connected." Checking for device capabilities causes the response "Not Supported" to be returned. Trying to ping the device results in "No Connection." So I tried to do a firmware reset. 

 

I connected the 3v line to the expost contact next to GPIO #0. Nothing happens, the device doesn't reset.  When I've done resets before I've been able to use the SAM-BA tool to reflash the device once it shows as a serial device. But this never shows up as a Serial device. It still shows up as a USB Netduino device. 

 

Is there any other way to reset the device?

 




#48033 Unable to reset Netduino

Posted by j2inet on 04 April 2013 - 06:25 PM in Netduino Plus 2 (and Netduino Plus 1)

Thanx! That was it. 




#48215 High Resolution Delay

Posted by j2inet on 09 April 2013 - 02:50 PM in Netduino Plus 2 (and Netduino Plus 1)

I've just come up with a solution for my needs. I'm using a spin wait. 

 

When my program starts up I time how long it takes to perform 2^20 increments (this way the delay should work across different processor clock waits). Then I just use this information to decide how many cycles to wait. For the timing values that I need it looks like this should work. I've not accounted for the overhead of making the call to the method but I hope that it will be within tolerance for my application. 

 

Source code is below. The default calibration value is from a Netduino Plus 2 with the source code running in debug mode. As long as you call calibrate before using it the default value should not matter. 

    public class SpinWaitTimer    {        double _cyclesPerSecond = 112262.2255516001;        public double CyclesPerSecond        {            get { return _cyclesPerSecond; }            set { _cyclesPerSecond = value; }        }        public SpinWaitTimer()        {        }        public void Calibrate()        {            const int CYCLE_COUNT = 1048576;            int dummyValue = 0;            DateTime startTime = DateTime.Now;            for (int i = 0; i < CYCLE_COUNT; ++i)            {                ++dummyValue;            }            DateTime endTime = DateTime.Now;            TimeSpan timeDifference = endTime.Subtract(startTime);            _cyclesPerSecond = ((double)CYCLE_COUNT / (double)timeDifference.Ticks)*10000000d;        }        public void WaitSeconds(double sec)        {            int cycleCount = (int)((sec * CyclesPerSecond));            int dummyValue = 0;            for (int i = 0; i < cycleCount; ++i)            {                ++dummyValue;            }        }        public void WaitMilliseconds(double microseconds)        {            int cycleCount = (int)(_cyclesPerSecond * CyclesPerSecond / 1000d);            int dummyValue = 0;            for (int i = 0; i < cycleCount; ++i)            {                ++dummyValue;            }        }        public void WaitMicroseconds(double microseconds)        {            int cycleCount = (int)(_cyclesPerSecond * CyclesPerSecond / 1000000d);            int dummyValue = 0;            for (int i = 0; i < cycleCount; ++i)            {                ++dummyValue;            }        }    }



#48236 High Resolution Delay

Posted by j2inet on 10 April 2013 - 01:26 AM in Netduino Plus 2 (and Netduino Plus 1)

I'd be interested to see how reliable your solution is as NETMF is multithreading.  The garbage collector can be invoked at any time and you have no control over this.  What happens if an interrupt occurs part way through your loop?  Again this is something you will have no control over.

 

Good luck but my thoughts we going towards adding native code to the firmware to achieve what you want.

 

Thanx. The GC should't be an issue since this is running a single thread and using preallocated buffers and the other hardware would resend the message if an acknowledgement isn't received. I'll be sure to look into putting native code into the firmware for a long term fix. I can't say I am yet familiar with how to do that on Netduino. I had looked to see if there was support for loading native code (like some of the GHI hardware does) but it doesn't look like that will be an option. 

 

Any pointers of where I would look to get started with modifying the firmware? I've found the source code download links on the home page.  What else should I download or read?




#48214 High Resolution Delay

Posted by j2inet on 09 April 2013 - 02:00 PM in Netduino Plus 2 (and Netduino Plus 1)

I wanted to check and see if this is something that is reasonably possible on a Netduino Plus 2 before I try to work it into a solution. I need to interface to a device that uses serial communication. The device is usually sleeping, but when I need to send it a message I've got to pulse a wake up line for 50 to 100 ?s and then start sending my message 9 to 11 ?s later. As far as I can tell the only delay functionality available on the netduino takes time in ms, not ?s. I thought about doing a busy loop and probing a clock, but from what I can tell I can't get information in the needed resolution to do this with the clock. 

 

Is this something that I could do with the Netduino Plus 2 or should I seek a different solution?




#48073 GPRS Shield

Posted by j2inet on 05 April 2013 - 03:59 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

I am using this code

http://netduino2seedgsm.codeplex.com/

 

and this hardware

http://www.seeedstud...l?cPath=132_134

 

Managed to send sms ok however reading all SMS have been no joy.

 

Just wondering y whthe visual studio output produces funny characters: eg AÕi5GªA,j etc etc even thought the code is converted byte[] from utf8 string.

 

Have you taken a look at the byte stream that has come back to verify that the problem isn't in the data itself? The range of the byte values you get back should be between 0x20(32) and 0x7E (126~) if you are getting back plain english text. If you see your values are outside this range then the problem isn't with your conversion, it's with the data itself.  




#48045 NP2 not responding

Posted by j2inet on 04 April 2013 - 08:31 PM in Netduino Plus 2 (and Netduino Plus 1)

Is it possible that board/stm is broken but somehow it passes reflashing without problems??

I've been experiencing a similar problem over the last few days. In my case it seems if an unhandled exception happens early in the program than the board halts and I can't deploy anything to it. After that I have to reflash since resetting doesn't seem to work. I speculate that on a reset it's starting off running my program and halting before I can do another redeployment. 

 

During development I've found it helpful to put a 4 second delay at the start of my program (via Thread.Sleep). When the board is halted I can at least reset it and have 4 seconds to get a deployment going before the problem code executes. 




#48311 Oreilly Book: NP2?

Posted by j2inet on 11 April 2013 - 08:37 PM in Netduino Plus 2 (and Netduino Plus 1)

While either should work fine for that book I would go with the Netduino Plus 2. In just glancing at the spec sheets a few things stand out. 

 

Netduino Plus Specs: http://www.netduino....oplus/specs.htm

Netduino Plus 2 Spects: http://netduino.com/...plus2/specs.htm

 

 

Netduino Plus:

[font="Tahoma;font-size:small;"] ?[/font] [font="Tahoma;font-size:small;"]Speed: 48MHz, ARM7[/font] [font="Tahoma;font-size:small;"]
?[/font] [font="Tahoma;font-size:small;"]Code Storage: 64 KB[/font]
[font="Tahoma;font-size:x-small;"]without networking: 128 KB[/font] [font="Tahoma;font-size:small;"]
?[/font] [font="Tahoma;font-size:small;"]RAM: 42 KB
without networking: 60 KB[/font] digital i/o features Posted Image[font="Tahoma;font-size:small;"]
?[/font] all 20 digital and analog pins: GPIO [font="Tahoma;font-size:small;"]
?[/font][font="Tahoma;font-size:small;"]digital pins 0-1: UART 1 RX, TX[/font] [font="Tahoma;font-size:small;"]
?[/font] digital pins 2-3: UART 2 RX, TX [font="Tahoma;font-size:small;"]
?[/font] digital pins 5-6: PWM, PWM [font="Tahoma;font-size:small;"]
?[/font] digital pins 7-8: UART 2 RTS, CTS [font="Tahoma;font-size:small;"]
?[/font] digital pins 9-10: PWM, PWM [font="Tahoma;font-size:small;"]
?[/font] digital pins 11-13: SPI MOSI, MISO, SPCK [font="Tahoma;font-size:small;"]
?[/font] analog pins 4-5: I2C SDA, SCL

 

etduino Plus 2: 

 

[font="Tahoma;font-size:small;"]?[/font] [font="Tahoma;font-size:small;"]Speed: 168MHz, Cortex-M4[/font] [font="Tahoma;font-size:small;"]
?[/font] [font="Tahoma;font-size:small;"]Code Storage: 384 KB[/font] [font="Tahoma;font-size:small;"]
?[/font] [font="Tahoma;font-size:small;"]RAM: 100+ KB[/font]

 

 

digital i/o features Posted Image[font="Tahoma;font-size:small;"]
?[/font] all 22 digital and analog pins: GPIO [font="Tahoma;font-size:small;"]
?[/font] [font="Tahoma;font-size:small;"]digital pins 0-1: UART 1 RX, TX[/font] [font="Tahoma;font-size:small;"]
?[/font] digital pins 2-3: UART 2 RX, TX/PWM [font="Tahoma;font-size:small;"]
?[/font] digital pins 5-6: PWM, PWM [font="Tahoma;font-size:small;"]
?[/font] digital pins 7-8: UART 3 RX, TX
(also works as UART 2 RTS, CTS) [font="Tahoma;font-size:small;"]
?[/font] digital pins 9-10: PWM, PWM [font="Tahoma;font-size:small;"]
?[/font] digital pins 11-13: PWM/MOSI, MISO, SPCK [font="Tahoma;font-size:small;"]
?[/font] digital pin SD/SC: SDA/SCL
(also works as UART 4 RX, TX)




#48042 Code only appears to execute when breakpoint is set

Posted by j2inet on 04 April 2013 - 08:10 PM in Netduino Plus 2 (and Netduino Plus 1)

I've set up a PWM in my code that's going to be controlling a servo. 

 

PWM throttlePort2 = new PWM(PWMChannels.PWM_PIN_D11, 2000, 0.0, false);//throttlePort2.Frequency = 2000;//throttlePort2.DutyCycle = 0;throttlePort2.Start();

 

I've set up an event handler for incoming data from a COM port. Data is sent about 4 to 8 times per second depending on conditions. When that data is received I'm using it to alter the duty cycle on the PWM. 

 

double _throttlePosition;public double ThrottlePosition{    get { return _throttlePosition; }    set     {        if (value != _throttlePosition)        {            _throttlePosition = value;            if (throttlePort != null)                throttlePort.DutyCycle = _throttlePosition;        }    }}

 

When the code is running the PWM doesn't ever appear to be altered. If I set a breakpoint here and allow the code to continue immediately after the breakpoint then it executes fine. But it only seems to execute under this condition. In verifying what was going on I tried using the PWM on the onboard led and also tried with a speaker connected to the PWM pin. Both yield the same results. Is there anything I'm doing wrong?

 

I found another thread from 2 years ago about an odd behaviour (bug?) that occurs if you don't empty the read buffer (http://forums.netdui...recieved-event/). But I don't know if it is applicable given the way that I am reading from the port. 

 

void OnControlDataReceived(object sender, SerialDataReceivedEventArgs e){    while (_controlPort.BytesToRead > 0)    {        int bytesToReadCount = _controlPort.BytesToRead;        int bytesRead = _controlPort.Read(                          _receiveBuffer,                           _receiveBufferLocation,                           _controlPort.BytesToRead            );        _receiveBufferLocation += bytesRead;        CheckBufferForFlush(); //<-- some stuff happens here                                //to empty _receiveBuffer    }}

 

 





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.