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.

GlenS's Content

There have been 22 items by GlenS (Search limited from 21-April 23)


By content type

See this member's

Sort by                Order  

#42505 Diodes and SN754410

Posted by GlenS on 31 December 2012 - 03:37 PM in Netduino Plus 2 (and Netduino Plus 1)

CW2, Arbiter and supra,

 

Thanks guys for the response. TBH, I had missed the diodes in the datasheet, and will probably not use the external ones in this project. I'm attempting to create a controller for this robot arm (sold by Maplin in the UK) using the Netduino and a couple of joysticks. The next step will then to hook it up to a RC transmitter, to replace the joysticks :)




#42500 Diodes and SN754410

Posted by GlenS on 31 December 2012 - 02:20 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

I am designing a system to control 4 low voltage dc motors using a couple of SN754410 ic's. I have read different opions on the use of Schottky diodes to protect agains reverse voltage from the motors, some say use them, others say they are not necessary. I'm fairly new to Micro electronics, software being my bag, so what is the opions of all you experts on here. Thanks for any feedback, and Happy New year to you all

 

Glen

 




#40537 Netduino Plus 2 Firmware v4.2.1 (Update 1)

Posted by GlenS on 30 November 2012 - 09:06 PM in Netduino Plus 2 (and Netduino Plus 1)

Thanks Guys



#40507 Netduino Plus 2 Firmware v4.2.1 (Update 1)

Posted by GlenS on 30 November 2012 - 01:14 PM in Netduino Plus 2 (and Netduino Plus 1)

Chris, Is this update compatible with the N+1? Glen



#40434 Netduino Plus - I2C not working

Posted by GlenS on 29 November 2012 - 05:59 PM in Netduino Plus 2 (and Netduino Plus 1)

Basically, it is device-specific. When there is "repeated start condition" mentioned in the device communication protocol description, or it has some kind of addressing scheme (register + data, address + data), those special methods are usually required.



Thanks CW2



#40423 Netduino Plus - I2C not working

Posted by GlenS on 29 November 2012 - 01:49 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

Just been thinking about this repeatable read fix (link). Can this be applied in all cases, or will the code have to be used on a device by device basis?

many thanks

Glen



#26266 Serial comms 101

Posted by GlenS on 02 April 2012 - 11:40 AM in General Discussion

Hi Gorf, Also, have you got the Rx and Tx pins connected correctly. It looks like you have the Rx from the breakout connected to the Rx (pin 0) of the N+, and the same therefore with tthe Tx pins. These should be in a cross-over configuration - ie. Tx from breakout -> Pin 0 N+, Rx from breakout to Pin 1 N+ Glen



#26016 How to use UART0 in netduino board

Posted by GlenS on 27 March 2012 - 12:50 PM in Netduino 2 (and Netduino 1)

Sorry I need to use UART1 (PA5 and PA6) on the SAM7x512 chip, can any one point me out how can access this UART1.


Hi Suresh - does this help..

You would then use

SerialPort serialPortCP5200 = new SerialPort("COM2", 9600, Parity.None, 8, StopBits.One);

to access the 2nd comm port

best of luck
Glen



#25767 Multiple LDR's not working

Posted by GlenS on 20 March 2012 - 12:40 PM in Netduino Plus 2 (and Netduino Plus 1)

Clusta, Quick look at the breadboard - if its anything like mine, there is no V+ connection through to the right-hand pair of LDR devices. I'm basing that on the break in the red and blue lines imprinted on the breadboard, on mine that signals a break in the copper rail underneath. Is this your issue? Glen



#25581 Mulitplex Keypad Output

Posted by GlenS on 15 March 2012 - 10:24 PM in Netduino Plus 2 (and Netduino Plus 1)

Ok,

After a weekend away and a busy week at work, I have returned to this with "proper" diodes and finally managed to get the project to work. I see the same as Paul in that the values returned seem to be reversed from his theory. Below is a work-in-progress driver class for the setup. It needs a lot of work, especially in improving area of key-debounce. I am seeing far too often double key presses. I would like to improve the oversized switch statement as well.

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
#if Netduino 
using SecretLabs.NETMF.Hardware.Netduino;
#else
using SecretLabs.NETMF.Hardware.NetduinoPlus;
#endif

namespace KeypadTest
{
    public class KeypadDriver 
    {

        public delegate void KeyPressHandler(object sender, char keyPressed);
        
        public KeypadDriver(int debounce=250)
        {
            this.debounce = debounce;
            keyReader = new Thread(new ThreadStart(ReadKeyPad));
            keyReader.Start();
        }

        public event KeyPressHandler OnKeyPressed;

        private void ReadKeyPad()
        {
            while (true) 
            {
                readbuffer[0] = 0x00;
                writebuffer[0] = 0x01;
                spi.WriteRead(writebuffer, readbuffer);
                if (readbuffer[0] != 0xFF)
                {
                    char result = '+'; // need to define something ...
                    switch (readbuffer[0])
                    {
                        case 0x88:
                            result = '1';
                            break;
                        case 0x84:
                            result = '2';
                            break;
                        case 0x82:
                            result = '3';
                            break;
                        case 0x81:
                            result = 'A';
                            break;
                        case 0x48:
                            result = '4';
                            break;
                        case 0x44:
                            result = '5';
                            break;
                        case 0x42:
                            result = '6';
                            break;
                        case 0x41:
                            result = 'B';
                            break;
                        case 0x28:
                            result = '7';
                            break;
                        case 0x24:
                            result = '8';
                            break;
                        case 0x22:
                            result = '9';
                            break;
                        case 0x21:
                            result = 'C';
                            break;
                        case 0x18:
                            result = '*';
                            break;
                        case 0x14:
                            result = '0';
                            break;
                        case 0x12:
                            result = '#';
                            break;
                        case 0x11:
                            result = 'D';
                            break;
                    }
                    if (OnKeyPressed != null)
                    {
                        OnKeyPressed(this, result);
                    }
                }
                Thread.Sleep(debounce);
            }
        }

        private Thread keyReader;
        private int debounce;
        private byte[] readbuffer = new byte[1];
        private byte[] writebuffer = new byte[1];
        private SPI spi = new SPI(new SPI.Configuration(Pins.GPIO_NONE, false, 0, 0, false, true, 32, SPI.SPI_module.SPI1));
    }
}

An example use:-

public class Program
    {
        public static void Main()
        {
            // write your code here
            KeypadDriver driver = new KeypadDriver();
            driver.OnKeyPressed += new KeypadDriver.KeyPressHandler(driver_OnKeyPressed);
            while (true)
            {
                Thread.Sleep(250);
            }
        }

        static void driver_OnKeyPressed(object sender, char keyPressed)
        {
            Debug.Print("Key Pressed = " + keyPressed.ToString());
        }
    }

Once again thanks to Mario and Paul for the efforts they both put in answering my original query. Paul, please feel free to add this code to the wiki article, I'm afraid I had a look but could not work out the process.

Glen



#25393 One question about interrupts.

Posted by GlenS on 11 March 2012 - 11:05 PM in Netduino 2 (and Netduino 1)

Hello Irda,

I think what you need is the System.Threading.Timer class. The constructor takes a callback, some state and the parameters that represent when the timer is fired. The first indicates when the timing starts (zero is immediately) and the 2nd is the period in milliseconds.

i.e.

using System.Threading;
using Microsoft.SPOT;

namespace TimerTest
{
    public class Program
    {
        public static void Main()
        {
            // write your code here
            Timer timer = new Timer(new TimerCallback(OnTimer), null, 0, 1000);
            Thread.Sleep(Timeout.Infinite);
        }

        public static void OnTimer(object state)
        {
            Debug.Print("Timer fired");
        }

    }
}

Hope this helps

Glen



#25391 Mulitplex Keypad Output

Posted by GlenS on 11 March 2012 - 09:36 PM in Netduino Plus 2 (and Netduino Plus 1)

Paul,

Glad to hear you have the project working. Still no joy at my end, although I am now seeing the LED's flash when the button connection is made. In terms of the Hex code output, the ToString() method in the Micro .NET framework does not implement conversion directly to hexadecimal. I do have this code that I use, and offer it up in thanks for your help.

public static class HexHelper
    {
        public static string ToHexString(this byte value)
        {
            char[] hexValues = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
            string result = hexValues[value / 16].ToString() + hexValues[value % 16].ToString();
            return result;
        }
    }

Please go ahead and put the work on the wiki, I'm sure the good work you and Mario have done here will benefit the community.

Once again many thanks.

Glen



#25374 Mulitplex Keypad Output

Posted by GlenS on 11 March 2012 - 01:26 PM in Netduino Plus 2 (and Netduino Plus 1)


Did you spot that I forgot to connect the OE line to ground?
Sorry about that.


Hi Paul,

Yes, I had spotted that, I have also tied the MR line high, rather than drive it though the Netduino. Is that correct. One other thing I have thought about as well, and this is probably the clincher. I am using LED's rather than ordinary diodes, mainly as I don't have enough in my kit bag, but also I thought it would be cool to visualise the effect of closing the keypad switches. I'm thinking, and am on very new-be territory now, that the resistor R1 should be a lower value if I'm using LED's.

Glen



#25368 Mulitplex Keypad Output

Posted by GlenS on 11 March 2012 - 11:19 AM in Netduino Plus 2 (and Netduino Plus 1)

Paul,

Some early feedback. Having built your circuit on a breadboard, I'm finding that the value I'm getting back from the SPI WriteRead never changes from 0xFF. I'm currently re-working the build to make sure I have everything correct and will report back later this evening.

Software-wise I have this simple test rig .

public class Program
    {
        public static void Main()
        {
            // write your code here
            SPI spiDriver = new SPI(new SPI.Configuration(Pins.GPIO_NONE, false, 0, 0, false, false, 32, SPI.SPI_module.SPI1));
            byte[] readbuffer = new byte[1];
            byte[] writebuffer = new byte[1];

            while (true)
            {
                writebuffer[0] = 0x01;
                readbuffer[0] = 0x00;
                spiDriver.WriteRead(writebuffer, readbuffer);
                Debug.Print(readbuffer[0].ToString());
                Thread.Sleep(100);
            }

        }

    }

Many thanks for your continued support and interest in my quest ..



#25229 Mulitplex Keypad Output

Posted by GlenS on 08 March 2012 - 12:21 PM in Netduino Plus 2 (and Netduino Plus 1)

Paul / Mario Cheers Guys. I'm quite new into the micro-electronics field - bit of an evenings hobby, so am certainly looking for the fun aspect. I will have a go at both solutions (Mario's first as I have all the parts in my kit bag already) and report back. Glen



#25188 Mulitplex Keypad Output

Posted by GlenS on 07 March 2012 - 08:00 PM in Netduino Plus 2 (and Netduino Plus 1)

Paul / unr34l-dud3 Thanks both for the advice. The wiring is very similar to the 4x3 example, except that there is an extra column of letters on the keypad. I have looked around and seem now to think that I should be able to use a 74C922 interface chip and use that either directly using 5 netduino pins, or have the 4 output pins drive the 74HC165 for SPI compatibility. Downside is the relative expense of the 74C922. I'll investigate the PIC route. Glen



#25184 Mulitplex Keypad Output

Posted by GlenS on 07 March 2012 - 05:42 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi, Am I on the right lines thinking I can reduce the 8 pin output of a 4x4 matrix keypad, down to a SPI based interface using a 74HC165 mulitplex chip. many thanks



#24937 HttpListener does not respond

Posted by GlenS on 01 March 2012 - 11:30 PM in General Discussion

Ganesh, I haven't had the time to do any in-depth stdy, but what I think you may be seeing is the result of HTTP requests overlapping. Some quick testing I did was everythign seemed to work if I was slow in hitting the F5 refresh in Firefox, but if I hit it very quickly I hit the error you describe very quickly. Take a look at the code from Jasper Schuurmans at : http://www.schuurman...lus#comment-256 He has an excelent multi-threaded web server that you could adapt to your needs. I have used it in one of my demo projects without any issues once I had fixed a small issue he had in the code that did not return a complete HTTP header in the response. This was causing the response to fail on some mobile devices. Hope this helps Glen



#24930 Unstable with 9v P9 battery

Posted by GlenS on 01 March 2012 - 08:33 PM in Netduino Plus 2 (and Netduino Plus 1)

Ok thanks everyone. Measured the current draw at the +5V rail at 280mA or there abouts (£10 multimeter accuracy :rolleyes:) Changed to 4 x AA batteries and now every thing is stable again, and more importantly mobile. I'm new to this micro-electronics stuff and that's the first lesson learned - 9v P9 batteries re good for nothing..



#24900 Unstable with 9v P9 battery

Posted by GlenS on 01 March 2012 - 01:37 PM in Netduino Plus 2 (and Netduino Plus 1)

I think 9V is a bit much, that poor lil regulator has to convert more than 5V to heat. Try 4 AAs = 6V on the input.


Isn't the N+ rated at 7.5 -> 12V on the power input though?



#24897 Unstable with 9v P9 battery

Posted by GlenS on 01 March 2012 - 12:50 PM in Netduino Plus 2 (and Netduino Plus 1)

Do you have any chance to measure the current drawn from the battery? Isn't it possible that the components draw too much current?


Thanks CW2,

I don't have access to a meter at the moment, but just looked at the specs of the Max7219 and LM35 and together there could be upto 400mA of power for those alone. The spec of the battery is 400mA/h so I'm guessing it aint just up to the job. A 9V Alkaline cell isn't much better either. Will move to 6 x AA I think and see how that goes.



#24881 Unstable with 9v P9 battery

Posted by GlenS on 29 February 2012 - 11:39 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi, I have a project working fine on a N+ when powered via a USB cable. The projects reads temperature via a LM35DZ and outputs the temperature to a couple of 7-segment LED's via a MAX7219 driven through SPI. My issue is that I seem to be experiencing, after a few seconds of operation, fluctuations both the 5v and 3.3v power lines being used to power the components. The battery is connected directly to a battery clip, wired directly to a 2.5mm plug. Have I missed something in providing power to the N+ this way. Should I be regulating the battery supply at all? Is a 9v Zinc Chloride battery really up to the job?




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.