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.

xmakina's Content

There have been 13 items by xmakina (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#49382 Outputting to I/Os in parallel

Posted by xmakina on 13 May 2013 - 12:42 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

I need to set an 8-bit device. I am using a netduino plus 2. If I want to set DB0 - DB7 to a specific byte, say "45" (hex), how can I set the bit simultaneously instead of setting each bit:

 

I know it can be done like this:

 

db0.write(true);

db1.write(false);

db2.write(true);

db3.write(false);

 

 

db4.write(false);

db5.write(false);

db6.write(true);

db7.write(false);

 

 

but can I set something like this in parallel ?

 

Thanks,

 

xMakina

 




#49059 Unable to deploy to NDP2 after deploying code to test PWM

Posted by xmakina on 05 May 2013 - 07:24 AM in Netduino Plus 2 (and Netduino Plus 1)

My program above was wrong. Though, it seems firmware 4.3 beta also have it share of bugs. I tried re-flashing to the older firmware version, 4.2.1, and this corrected code ran perfectly. but when I tried it on firmware v4.3,VS does not even hit the breakpoint, and the debugger just exits suddenly without anything happening.

 

I guess that firmware 4.3 beta is still buggy. Reverting back to firmware v4.2.1....

 

This is the correct one:

 

 

 public class Program
    {
        // setup analog input
     
        static SecretLabs.NETMF.Hardware.AnalogInput potentiometer = new
                   secretLabs.NETMF.Hardware.AnalogInput(Pins.GPIO_PIN_A0);
 
        // use an output port that can handle PWM (pin D5,D6,D9,etc.)
        static PWM pulseWidthModulatedLed = new PWM(PWMChannels.PWM_PIN_D5, 100, 0.5, false); // Set later
     
        public static void Main()
        {
            potentiometer.SetRange(0, 100); // to make this show value in % 
 
            pulseWidthModulatedLed.Frequency = 200;
            pulseWidthModulatedLed.Start();
 
            int potentiometerValue = 0;
            double percent = 0;            
 
            while (true)
            {
                // By default, Read() will return int type from 0-1023 by default
                // But here, the range was customized to return values 
                // from 0, 100
                potentiometerValue = potentiometer.Read();
 
                // divide the read integer value to get the decimal value
                percent = potentiometerValue / 100.0; 
 
                // dutycycle(a double type) needs a value from 0 to 1
                pulseWidthModulatedLed.DutyCycle = percent;
             
            }
        }
    }



#49058 Unable to deploy to NDP2 after deploying code to test PWM

Posted by xmakina on 05 May 2013 - 07:24 AM in Netduino Plus 2 (and Netduino Plus 1)

UPDATE: 

 

I have already re-flashed. Now I can ping it, and it now responds when I click the "Device Capabilities". Then I encountered this:

 

Error 1 Cannot deploy the base assembly 'mscorlib', or any of his satellite assemblies, to device - USB:Netduino twice. Assembly 'mscorlib' on the device has version 4.3.0.0, while the program is trying to deploy version 4.2.0.0
 

So I changed my project's  target framework to 4.3 and I can now deploy to NDP2 successfully But when the program runs, nothing happens except the on-board LED lights up constantly.(In my program, I don't even have any mention of the on-board led.) Also, VS suddenly exits the debug mode and nothing's happening.

 

Do you think this has something to do with the new firmware ?

 

Pinging... TinyCLR

Pinging... TinyCLR
Pinging... TinyCLR
 
Also, where do I download the firmware files itself , not the source files , as I am not familiar with C++ ? (I assume the .DFU file is the firmware right? )
 
I tried to re-flash again, and the on-board light went off. But when I ran the program again, it lit up again. (Again, In my program, I don't even have any mention of the on-board led.)

 

 

Thanks,

 

xMakina




#49057 Unable to deploy to NDP2 after deploying code to test PWM

Posted by xmakina on 05 May 2013 - 07:23 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

I am unable to deploy to NDP2 after deploying my code that tests the pulse width modulator.

Error was "There were deployment errors". Tried to restart the PC, disconnected and reconnected the NDP2, but to no avail.

 

 

namespace AnalogPulseWidthModulation
{
    public class Program
    {
        // setup analog input
        static SecretLabs.NETMF.Hardware.AnalogInput potentiometer = new SecretLabs.NETMF.Hardware.AnalogInput(Pins.GPIO_PIN_A0);
        static SecretLabs.NETMF.Hardware.PWM pulseWidthModulatedLed = new SecretLabs.NETMF.Hardware.PWM(Pins.GPIO_PIN_D0);
     
        public static void Main()
        {
            potentiometer.SetRange(0, 100); // to make this show value in % 
 
            int potentiometerValue = 0;
 
            while (true)
            {
                // By default, Read() will return 0-1023 by default
                // But here, the range was customized to return values 
                // from 0, 100
                potentiometerValue = potentiometer.Read();
                pulseWidthModulatedLed.SetDutyCycle((uint)potentiometerValue);                
            }
        }
    }
}
 

I tried to re-flash as suggested above. But when I got to "Device Capabilities" it said "Not Supported", I have .NET Microframework SDK 4.3 (RTM) and Netduino SDK v4.2.2.

 

What should I do ? Was there any problem in my code that made the NDP2 stop responding ?

 

Thanks and regards,

 

xMakina




#49053 Unable to communicate with Netduino Plus 2

Posted by xmakina on 05 May 2013 - 04:06 AM in Netduino Plus 2 (and Netduino Plus 1)

My program above was wrong. Though, it seems firmware 4.3 beta also have it share of bugs. I tried re-flashing to the older firmware version, 4.2.1, and this corrected code ran perfectly. but when I tried it on firmware v4.3,VS does not even hit the breakpoint, and the debugger just exits suddenly without anything happening.

 

I guess that firmware 4.3 beta is still buggy. Reverting back to firmware v4.2.1....

 

This is the correct one:

 

 

 public class Program
    {
        // setup analog input
     
        static SecretLabs.NETMF.Hardware.AnalogInput potentiometer = new
                   secretLabs.NETMF.Hardware.AnalogInput(Pins.GPIO_PIN_A0);
 
        // use an output port that can handle PWM (pin D5,D6,D9,etc.)
        static PWM pulseWidthModulatedLed = new PWM(PWMChannels.PWM_PIN_D5, 100, 0.5, false); // Set later
     
        public static void Main()
        {
            potentiometer.SetRange(0, 100); // to make this show value in % 
 
            pulseWidthModulatedLed.Frequency = 200;
            pulseWidthModulatedLed.Start();
 
            int potentiometerValue = 0;
            double percent = 0;            
 
            while (true)
            {
                // By default, Read() will return int type from 0-1023 by default
                // But here, the range was customized to return values 
                // from 0, 100
                potentiometerValue = potentiometer.Read();
 
                // divide the read integer value to get the decimal value
                percent = potentiometerValue / 100.0; 
 
                // dutycycle(a double type) needs a value from 0 to 1
                pulseWidthModulatedLed.DutyCycle = percent;
             
            }
        }
    }



#49021 Unable to communicate with Netduino Plus 2

Posted by xmakina on 04 May 2013 - 11:10 AM in Netduino Plus 2 (and Netduino Plus 1)

UPDATE: 

 

I have already re-flashed. Now I can ping it, and it now responds when I click the "Device Capabilities". Then I encountered this:

 

Error 1 Cannot deploy the base assembly 'mscorlib', or any of his satellite assemblies, to device - USB:Netduino twice. Assembly 'mscorlib' on the device has version 4.3.0.0, while the program is trying to deploy version 4.2.0.0
 

So I changed my project's  target framework to 4.3 and I can now deploy to NDP2 successfully But when the program runs, nothing happens except the on-board LED lights up constantly.(In my program, I don't even have any mention of the on-board led.) Also, VS suddenly exits the debug mode and nothing's happening.

 

Do you think this has something to do with the new firmware ?

 

Pinging... TinyCLR

Pinging... TinyCLR
Pinging... TinyCLR
 
Also, where do I download the firmware files itself , not the source files , as I am not familiar with C++ ? (I assume the .DFU file is the firmware right? )
 
I tried to re-flash again, and the on-board light went off. But when I ran the program again, it lit up again. (Again, In my program, I don't even have any mention of the on-board led.)

 

 

Thanks,

 

xMakina




#49020 Unable to communicate with Netduino Plus 2

Posted by xmakina on 04 May 2013 - 10:28 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

I am having the same problem as this one. 

 

This was made latest code when suddenly it said "There were deployment errors" . Tried to restart the PC, disconnected and reconnected the NDP2, but to no avail.

 

 

namespace AnalogPulseWidthModulation
{
    public class Program
    {
        // setup analog input
        static SecretLabs.NETMF.Hardware.AnalogInput potentiometer = new SecretLabs.NETMF.Hardware.AnalogInput(Pins.GPIO_PIN_A0);
        static SecretLabs.NETMF.Hardware.PWM pulseWidthModulatedLed = new SecretLabs.NETMF.Hardware.PWM(Pins.GPIO_PIN_D0);
     
        public static void Main()
        {
            potentiometer.SetRange(0, 100); // to make this show value in % 
 
            int potentiometerValue = 0;
 
            while (true)
            {
                // By default, Read() will return 0-1023 by default
                // But here, the range was customized to return values 
                // from 0, 100
                potentiometerValue = potentiometer.Read();
                pulseWidthModulatedLed.SetDutyCycle((uint)potentiometerValue);                
            }
        }
    }
}
 

I tried to re-flash as suggested above. But when I got to "Device Capabilities" it said "Not Supported", I have .NET Microframework SDK 4.3 (RTM) and Netduino SDK v4.2.2.

 

What should I do ? Was there any problem in my code that made the NDP2 stop responding ?

 

Thanks and regards,

 

xMakina




#48947 Setting Interrupt for Analog Input

Posted by xmakina on 02 May 2013 - 01:46 PM in Netduino Plus 2 (and Netduino Plus 1)

Thank you so much Chris and Cutlass. These are very informative. :)




#48914 Setting Interrupt for Analog Input

Posted by xmakina on 01 May 2013 - 10:09 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi Guys,

 

Can you help me on how to setup an interrupt for an analog input port, say Pins.GPIO_A0 ? I want to have an event handler that is triggered when the analog input voltage changes. Is this possible with my NDP2 ?

 

Thanks in advance,

 

xMakina




#48908 Digital Input Pull-up/Pull-down Resitor

Posted by xmakina on 01 May 2013 - 03:49 AM in Netduino Plus 2 (and Netduino Plus 1)

Thank you so much to both of you hanzibal and ziggurat. actually, choosing between your posts as best answer if by far more difficult than doing the hands-on itself. haha But thank you so much for both your posts and I hope you still have more designers to enlighten,

 

cheers !




#48902 Digital Input Pull-up/Pull-down Resitor

Posted by xmakina on 01 May 2013 - 01:40 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

I would like to clarify something with the Netduino. I bought a NDP2. I know you can change in code whether to use pull Port.ResistorMode.PullUp or Port.ResistorMode.PullDown. My question is, do I still have to add an external resistor component for the pull-up/pull-down or the board itself already provides the necessary resistors ? 

 

Thank you so much in advance.

 

xMakina




#48618 GPIO Current Source & Sink Capability

Posted by xmakina on 22 April 2013 - 01:44 PM in General Discussion

Thank you so much Hanzibal. You just confirmed what was running on my mind. I needed a second opinion badly as I didn't want to brink my newly-bought NDP2. 

 

THanks so much to you too Noom. Nice link there. Very informative.




#48579 GPIO Current Source & Sink Capability

Posted by xmakina on 20 April 2013 - 09:41 AM in General Discussion

Hi,

 

I am new to netduino and MCUs and I just got a new NETDUINO PLUS 2.

 

Can I use all 14 digital I/O's as output , driving 14 LEDS ? That's about 14 * 20mA = 280 mA. I read from the spec that Idd for the microcontroller should just be about 93 mA at ambient temp. Is it possible to drive all 14 I/O's for running LED's without exceeding the Idd in spec sheet ?

 

I was thinking about instead of current sourcing, I will just apply 5V external power supply and just make the 14 I/O pins sink or ground the LEDs.Will that make any difference ?

 

If not, what is the best solution to drive all 14 LEDs simultaneously using the NDP2 ?

 

Please help.

 

Thanks.





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.