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.

nturpin77's Content

There have been 20 items by nturpin77 (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#24555 Netduino Firmware v4.2.0 RC4 (Netduino + Netduino Plus)

Posted by nturpin77 on 22 February 2012 - 02:02 PM in Beta Firmware and Drivers

Ive ran into a problem trying to get my N+ recognized after the 4.2 update, Ive reflashed with Tiny bootloader and everything uploads successfully but when I run the MFDeploy tool afterwards and try to Ping the N+ I get no response. When I reflash with 4.1.06 i have no problems at all and everything runs great. Are there issues with early adopters of the N+? I have 3 N+ units and all do the same thing. Im using all the latest SDK that was on here for download. Ive used 3 different machines to eliminate any driver issues or USB possibilities. Im at a loss now where to go next. Should I just suck it up and continue to use the 4.1.06?



#13136 N+ Serial Read Frequency

Posted by nturpin77 on 11 May 2011 - 06:24 PM in Netduino Plus 2 (and Netduino Plus 1)

Good Afternoon and thanks for the info, some things to think about. @Nevyn - I have the Stopwatch class in right now for a different application but I will look at using it for data collection/formatting. Makes sense. @Tecchie - The Write line is there to output over a serial RS232 chip so I can read the data on a laptop or other computer real time, or near enough. As for the other line I found that without looking for the $ the code would always crash, I guess the better question for this line of code is why is it crashing without this line. Thanks again I will post results soon.......



#13122 N+ Serial Read Frequency

Posted by nturpin77 on 11 May 2011 - 12:45 PM in Netduino Plus 2 (and Netduino Plus 1)

Good Day all,

My question of the day is, is there a limit to the frequency that serial read can do. I have an IMU pack that outputs at 20Hz but when I read/log the data to the SD card we get about 1/3 of that. Obviously there is a limit to how fast the N+ can read from the serial UART but I wouldnt have thought it was 20Hz or less. Here is my code that reads/writes. We would like to read as much data as possible from the IMU, we can change the frequency up to 100Hz but 20Hz is as low as it can go.

public static void Main()
        {
            SerialPort port1 = new SerialPort("COM1", 57600, Parity.None, 8, StopBits.One);
            port1.Open();
            SerialPort Port2 = new SerialPort("COM2", 115200, Parity.None, 8, StopBits.One);
            Port2.Open();
            OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);
            FileStream fs = new FileStream("\\SD\\CTAP.txt", FileMode.OpenOrCreate, FileAccess.Write, FileShare.None, 512);
            StreamWriter sw = new StreamWriter(fs);
            //int j = 0;
            double currentTime = 0;
            double lastTime = 0;
            //ArrayList accz = new ArrayList();
            Stopwatch timing = Stopwatch.StartNew();
            

            while (true)
            {
                int GPStoRead = port1.BytesToRead;

                //start reading the stream
                if (GPStoRead > 0)
                {
                    //blink the LED to show we got data
                    led.Write(true);
                    //Thread.Sleep(100);
                    led.Write(false);
                    // get the waiting data
                    byte[] GPSbuffer = new byte[GPStoRead];
                    port1.Read(GPSbuffer, 0, GPSbuffer.Length);
                    port1.Write(GPSbuffer, 0, GPSbuffer.Length);
                    if (GPSbuffer[0] != 36)
                        continue;

                    String GPSMessage = new String(System.Text.Encoding.UTF8.GetChars(GPSbuffer));
                    Debug.Print(GPSMessage);
                    sw.Write(GPSMessage);

                }

                int CHRtoRead = Port2.BytesToRead;
               
                
                    if (CHRtoRead > 37)
                    {
                        int i = 0;
                        //blink the LED to show we got data
                        led.Write(true);
                        //Thread.Sleep(100);
                        led.Write(false);
                        // get the waiting data
                        byte[] CHRbuffer = new byte[CHRtoRead];
                        byte[] CHRoutput = new byte[20];
                        //serialPort2.Flush();
                        Port2.Read(CHRbuffer, 0, CHRbuffer.Length);

                        if (CHRbuffer[i] == 's')
                        {
                            //Print final result
                            i = i + 7;

                            YawVal = (int)((((CHRbuffer[i++] << 8) | CHRbuffer[i++]) << 16) >> 16);
                            String ShowYaw = YawVal.ToString();
                            YawCalc = YawVal * 0.0109863;
                            String ShowYCalc = YawCalc.ToString("F2");

                            PitchVal = (int)((((CHRbuffer[i++] << 8) | CHRbuffer[i++]) << 16) >> 16);
                            String ShowPitch = PitchVal.ToString();
                            PitchCalc = PitchVal * 0.0109863;
                            String ShowPCalc = PitchCalc.ToString("F2");

                            RollVal = (int)((((CHRbuffer[i++] << 8) | CHRbuffer[i++]) << 16) >> 16);
                            String ShowRoll = RollVal.ToString();
                            RollCalc = RollVal * 0.0109863;
                            String ShowRCalc = RollCalc.ToString("F2");
                            
                            string CTAP = "$CTAP,R," + ShowRCalc + ",P," + ShowPCalc + ",Y," + ShowYCalc + "\r\n";
                            sw.Write(CTAP);
                            CHRoutput = Encoding.UTF8.GetBytes(CTAP);
                            Port2.Write(CHRoutput, 0, CHRoutput.Length);

                            YRateVal = (int)((((CHRbuffer[i++] << 8) | CHRbuffer[i++]) << 16) >> 16);
                            String ShowYRate = YRateVal.ToString();
                            YRateCalc = YRateVal * 0.0137329;
                            String ShowYRateCalc = YRateCalc.ToString("F2");

                            PRateVal = (int)((((CHRbuffer[i++] << 8) | CHRbuffer[i++]) << 16) >> 16);
                            String ShowPRate = PRateVal.ToString();
                            PRateCalc = PRateVal * 0.0137329;
                            String ShowPRateCalc = PRateCalc.ToString("F2");

                            RRateVal = (int)((((CHRbuffer[i++] << 8) | CHRbuffer[i++]) << 16) >> 16);
                            String ShowRRate = RRateVal.ToString();
                            RRateCalc = RRateVal * 0.0137329;
                            String ShowRRateCalc = RRateCalc.ToString("F2");

                            xMagVal = (int)((((CHRbuffer[i++] << 8) | CHRbuffer[i++]) << 16) >> 16);
                            String ShowxMag = xMagVal.ToString();
                            xMagCalc = xMagVal * 0.061035;
                            String ShowxMagCalc = xMagCalc.ToString("F2");

                            yMagVal = (int)((((CHRbuffer[i++] << 8) | CHRbuffer[i++]) << 16) >> 16);
                            String ShowyMag = yMagVal.ToString();
                            yMagCalc = yMagVal * 0.061035;
                            String ShowyMagCalc = yMagCalc.ToString("F2");

                            zMagVal = (int)((((CHRbuffer[i++] << 8) | CHRbuffer[i++]) << 16) >> 16);
                            String ShowzMag = zMagVal.ToString();
                            zMagCalc = zMagVal * 0.061035;
                            String ShowzMagCalc = zMagCalc.ToString("F2");

                            xGyroVal = (int)((((CHRbuffer[i++] << 8) | CHRbuffer[i++]) << 16) >> 16);
                            String ShowxGyro = xGyroVal.ToString();
                            xGyroCalc = xGyroVal * 0.01812;
                            String ShowxGyroCalc = xGyroCalc.ToString("F2");

                            yGyroVal = (int)((((CHRbuffer[i++] << 8) | CHRbuffer[i++]) << 16) >> 16);
                            String ShowyGyro = yGyroVal.ToString();
                            yGyroCalc = yGyroVal * 0.01812;
                            String ShowyGyroCalc = yGyroCalc.ToString("F2");

                            zGyroVal = (int)((((CHRbuffer[i++] << 8) | CHRbuffer[i++]) << 16) >> 16);
                            String ShowzGyro = zGyroVal.ToString();
                            zGyroCalc = zGyroVal * 0.01812;
                            String ShowzGyroCalc = zGyroCalc.ToString("F2");

                            xAccVal = (int)((((CHRbuffer[i++] << 8) | CHRbuffer[i++]) << 16) >> 16);
                            String ShowxAcc = xAccVal.ToString();
                            xAccCalc = xAccVal * 0.106812;
                            String ShowxAccCalc = xAccCalc.ToString("F2");

                            yAccVal = (int)((((CHRbuffer[i++] << 8) | CHRbuffer[i++]) << 16) >> 16);
                            String ShowyAcc = yAccVal.ToString();
                            yAccCalc = yAccVal * 0.106812;
                            String ShowyAccCalc = yAccCalc.ToString("F2");
                            
                            currentTime = timing.ElapsedMilliseconds;
                            zAccVal = (int)((((CHRbuffer[i++] << 8) | CHRbuffer[i++]) << 16) >> 16);
                            String ShowzAcc = zAccVal.ToString();
                            zAccCalc = zAccVal * 0.106812;
                            //accz.Add(zAccCalc);
                            String ShowzAccCalc = zAccCalc.ToString("F2");

                            string CTSens = "$CTSens,Rates,Y," + ShowYRateCalc + ",P," + ShowPRateCalc + ",R," + ShowRRateCalc + ",Mags,X," + ShowxMagCalc + ",Y," + ShowyMagCalc + ",Z," + ShowzMagCalc + ",Gyros,X," + ShowyGyroCalc + ",Y," + ShowxGyroCalc + ",Z," + ShowzGyroCalc + ",Accels,X," + ShowxAccCalc + ",Y," + ShowyAccCalc + ",Z," + ShowzAccCalc + "\r\n";
                            sw.Write(CTSens);
                        }
                        else
                        {
                            i++;
                        }
                        
       
                    
                }



#11759 Elapsed time

Posted by nturpin77 on 07 April 2011 - 10:50 AM in Netduino Plus 2 (and Netduino Plus 1)

I got it to work with the Stopwatch Class. Thanks!



#11721 Elapsed time

Posted by nturpin77 on 06 April 2011 - 02:09 PM in Netduino Plus 2 (and Netduino Plus 1)

Is there an easy way to get an elapsed time? Ive read too many different code snippets and now have myself crosseyed. Im trying to just use DateTime.Now at the begining of the code and then subract it from DateTime.Now at the end but its not working too well for me atm. Thanks N



#11690 Strange Data on SDA/SCL

Posted by nturpin77 on 05 April 2011 - 12:01 PM in Netduino Plus 2 (and Netduino Plus 1)

is it possible that there is an issue with the clock? If the timing is off will that affect the way the I2C is read and data distributed/calculated? Is there a way to test the internal clock?



#11567 Strange Data on SDA/SCL

Posted by nturpin77 on 01 April 2011 - 01:44 PM in Netduino Plus 2 (and Netduino Plus 1)

Also here is a screenshot of a reading not sure if that helps either......screenshot.png



#11566 Strange Data on SDA/SCL

Posted by nturpin77 on 01 April 2011 - 01:40 PM in Netduino Plus 2 (and Netduino Plus 1)

Ok so I am running the actual BMP085 Program that was working before. It still works but the data is still all over the place and I have the logic analyer in place. I will attach the I2C export from the logic analyzer, not sure if that will tell anyone anything..... Its just a bunch of numbers and ack/nak to me lol

Attached Files

  • Attached File  i2c.txt   42.9KB   8 downloads



#11564 Strange Data on SDA/SCL

Posted by nturpin77 on 01 April 2011 - 01:12 PM in Netduino Plus 2 (and Netduino Plus 1)

D



#11563 Strange Data on SDA/SCL

Posted by nturpin77 on 01 April 2011 - 12:41 PM in Netduino Plus 2 (and Netduino Plus 1)

Worked like a champ! Thanks. I have the Logic Analyzer data in CSV format to upload here is that ok? or is there a better way to get it to you guys?



#11561 Strange Data on SDA/SCL

Posted by nturpin77 on 01 April 2011 - 12:04 PM in Netduino Plus 2 (and Netduino Plus 1)

Hello again

I have my logic analyzer and Im in the process of trying to get used to it. When I run this code I get an error for unhandled exception.

while (true)
{
new OutputPort(Pins.GPIO_PIN_A4, true);
new OutputPort(Pins.GPIO_PIN_A5, true);
}

Thats the only code I have in the program and is what I used to light up the LEDs to test the pins originally.



#11181 Strange Data on SDA/SCL

Posted by nturpin77 on 22 March 2011 - 06:04 PM in Netduino Plus 2 (and Netduino Plus 1)

Have you guys recieved your BMP085 and gotten a chance to play with it? Im still waiting on my logic analyzer. In my hastiness I ordered one from the manufacturer but apparently they were having manufacturing issues and now I have to wait to get mine but if I had ordered from SFE Id have one by now. Oh Murphys Law thank you for existing.....



#10816 Strange Data on SDA/SCL

Posted by nturpin77 on 11 March 2011 - 12:56 PM in Netduino Plus 2 (and Netduino Plus 1)

I couldnt find a Logic Analyzer in our dept anywhere so Ive gone ahead and ordered one from SFE. Hopefully will be here next week and I can do some diagnosing.



#10384 Strange Data on SDA/SCL

Posted by nturpin77 on 28 February 2011 - 12:28 PM in Netduino Plus 2 (and Netduino Plus 1)

Gday So Ive tested both Netduinos with LEDs on A4/A5 and I can light an LED with them. Does this confirm the functionality of SDA/SCL? or just the Analogue pins? I ask because I immediately plugged my BMP085 into both netduinos, well one at a time obviously, and still getting no data on one netduino and the all over the place data on the other. Ive tried all three BMP's and all with the same results. Any ideas on where to go next?



#10330 Strange Data on SDA/SCL

Posted by nturpin77 on 27 February 2011 - 09:25 PM in Netduino Plus 2 (and Netduino Plus 1)

I would tend to agree that reverse voltage would cause poor results but I can take the same bmp085 and plug it into my arduino and the output is normal,



#10201 Strange Data on SDA/SCL

Posted by nturpin77 on 25 February 2011 - 02:55 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi Chris, Yeah thats the piece of kit I picked up. Ive seen a lot of people use them so I guessed there was a large knowledge base out there for using it. I almost wish I had something else here that communicated on the SDA/SCL pins so I could confirm their functionality.



#10194 Strange Data on SDA/SCL

Posted by nturpin77 on 25 February 2011 - 02:02 PM in Netduino Plus 2 (and Netduino Plus 1)

Also I have taken a pic of the units together..... Netduino_BMP_Hookup (Medium).jpg



#10192 Strange Data on SDA/SCL

Posted by nturpin77 on 25 February 2011 - 01:45 PM in Netduino Plus 2 (and Netduino Plus 1)

This is the Fritzing Schematic, I had to build my own BMP085 part for it. I couldnt find one online, please excuse the sizing LOL. Netduino_BMP085.jpg



#10181 Strange Data on SDA/SCL

Posted by nturpin77 on 25 February 2011 - 12:47 PM in Netduino Plus 2 (and Netduino Plus 1)

The BMP085's do work with the arduino without any problems. Not sure how different the code is but the results are consistently good with it. Im installing Fritzing as I type this so I should have a schematic out in a little bit.



#10079 Strange Data on SDA/SCL

Posted by nturpin77 on 24 February 2011 - 01:18 PM in Netduino Plus 2 (and Netduino Plus 1)

Is it possible my SDA/SCL lines are bad? or the analogue lines in general? I have two netduinos and one the code works but gives back the strange data and the other one doesnt give me any data back at all. I am supplying the barometer with 3.3v from the netduino and the netduino is getting its power from the USB. Ive tried the BMP085's on an Arduino I have here and they work fine even though the altitude is showing 200m above where I really am. Thoughts/concerns?




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.