Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length



Pages: [1]
  Print  
Author Topic: ResistorMode.PullDown  (Read 280 times)
bberrevoets
Newbie
*
Posts: 13



View Profile WWW
« on: March 08, 2010, 11:30:50 AM »

Hello,

Can someone tell me what's wrong with the next code?

Code:
using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using ChipworkX.Hardware;

namespace MicroFrameworkFlashlight
{
    public class Program
    {
        public static void Main()
        {
            Cpu.Pin lampPin = Processor.Pins.PC5;
            Cpu.Pin switchPin = Processor.Pins.PA23;

            OutputPort lampOutput = new OutputPort(lampPin, false);
            InputPort switchInput = new InputPort(switchPin, false, Port.ResistorMode.PullDown);

            while (true)
            {
                lampOutput.Write(switchInput.Read());
            }
        }

    }
}


Greetings.
Logged
support
Administrator
Sr. Member
*****
Posts: 473


View Profile
« Reply #1 on: March 08, 2010, 12:41:28 PM »

ChipworkX hardware does not support internal pull down resistors on Digital IOs. only Pull ups are there.
Logged
bberrevoets
Newbie
*
Posts: 13



View Profile WWW
« Reply #2 on: March 08, 2010, 01:03:30 PM »

Hello,

Thanks for the quick response.

But does this mean that in the examples in the book "Embedded Programming with the Microsoft .NET Micro Framework" everything where stands InputPort.Read() i have to use !InputPort.Read() ?

Greetings.
Logged
SupportAdmin
Administrator
Hero Member
*****
Posts: 5394



View Profile WWW
« Reply #3 on: March 08, 2010, 02:18:04 PM »

no! that will not work. What hardware are you using?
Logged
bberrevoets
Newbie
*
Posts: 13



View Profile WWW
« Reply #4 on: March 08, 2010, 04:34:35 PM »

I use ChipworkX V1.5
Logged
SupportAdmin
Administrator
Hero Member
*****
Posts: 5394



View Profile WWW
« Reply #5 on: March 08, 2010, 04:59:50 PM »

I mean you use our development system? Then why do you need pull-down? pull-up should get you anything you like.

By the way, have you taken a look at our free ebook for NETMF? http://www.tinyclr.com/downloads/Beginners%20guide%20to%20NETMF.pdf
Logged
bberrevoets
Newbie
*
Posts: 13



View Profile WWW
« Reply #6 on: March 09, 2010, 01:01:20 AM »

Ok, what i use is microframework 3.0 and i use the chipworks development software.
I'am reading the book that i mentioned before from microsoft, which is for micro framework 3.0.
in the examples they use, they use pulldown just like int the code i showed, but when i use pullup,
because pulldown causes an error, everything is the opposite, so pushing the button gives me 0 and releasing it gives me 1.
So is this the correct behaviour, that what i mean?

 Greetings,

BBerreVOETS
Logged
bberrevoets
Newbie
*
Posts: 13



View Profile WWW
« Reply #7 on: March 09, 2010, 01:04:41 AM »

Ok, thanks i see it. i was right.

Everything i have to do the otherway around then the examples int he book.

Tnkx
Logged
Pages: [1]
  Print  
 
Jump to: