Welcome! Log In Create A New Profile

Advanced

PORT defines

Posted by SirPoonga 
PORT defines
March 23, 2010 10:48PM
I have a project that access the port pins directly (PORTD != (1 << pin)). I know port D is pins 8-15. I wired everything accordingly. The project works on the arduino but not on the sanguino. Do the PORT defines work?
Re: PORT defines
March 25, 2010 10:24PM
I mostly program in assembly. The syntax is much the same with the port defines.

What differs is what the pin on the port does. Since the Arduino and Sanguino use different processors, the functions on a given port may be on different pins.

-julie
Re: PORT defines
March 26, 2010 02:06AM
Correct. I verified the pins. PORTD on the sanguino is pins 8-15. However, the statement doesn't seem to work on the sanguino but works fine on the arduno (when appropiately wired).
Re: PORT defines
July 17, 2010 07:50AM
perhaps some special function has taken over the port pin? looks like the '644 has serial and some timer outputs sharing port D with gpio. the special functions usually override port bits when enabled.

Also, reading the PORT register instead of PIN can cause significant confusion- PORT returns the saved output value used when the port is an output, whereas the PIN register returns the actual digital value present on the pin in that instant.


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Sorry, only registered users may post in this forum.

Click here to login