doubts

Hi , may i know the difference between arm processors and arm m3 cortex processors, and apart from this may i know how and where to use the function operator int() and void mode(PinMode pull) and why do v use pulldown,pullup,pull none,pull drain

17 Nov 2010

Hi Ram,

The Cortex-M3 is one of the newer ARM processor architectures used in microcontrollers. For example, it is the processor used in the NXP LPC1768 microcontroller we use on the mbed NXP LPC1768 board. It is designed to be better for use in microcontrollers in many aspects compared to the previous microcontroller workhorse, the ARM7. You can see lots of details on the ARM Cortex-M3 Homepage, and I found a White paper introducing Cortex-M3 which has lots of interesting details (mixed in with "marketing").

The operator int() is just shorthand for read(), so for example you could do either of the following:

DigitalIn x(p5);
int y = x.read();   // use the read() method
int z = x;          // use the operator int() shorthand

The mode() function allows you to set whether a pin has an internal pullup resistor, pulldown resistor or neither enabled. For example, if a DigitalIn has a PullDown enabled (the default), it will read as 0 if nothing is connected. This is useful if you had a push button connected between the pin and +V. Alternatively, you could set an input to PullUp, then the pin would defualt to 1 when open, and you could have a button connected between the pin and 0V to toggle it.

Hope that helps,

Simon

Thanks Simon ,that helped me a lot

could u pls mention y do v use PullNone, OpenDrain mode in DigitalIn