Sign in

username:

password:



Not a member?

Search rabbit-semi



Search tips

Subscribe to rabbit-semi



Ads

Discussion Groups

Discussion Groups | Rabbit-Semi | Changing a pin value without affecting the other pins in the port

This is a group for folks designing and programming embedded systems using the Rabbit Semiconductor C-programmable microcontroller. Rabbit Semi is a spin-off from Z-World who makes a variety of embedded modules and tools. This group is not affiliated with either Rabbit or Z-World, but is a user forum for sharing ideas, asking questions, flaunting knowledge, and other typical user group stuff. The Rabbit is a powerful uC, supported by a full-featured C-compiler.

Changing a pin value without affecting the other pins in the port - Donald Shimoda - Jun 27 18:01:45 2008

I dont get how to change the state of a output ping without affecting
all the port.

In PICS, for change in portg the pin 5 you just do some like

PORTC.RC5 = 1;

but with rabbits seems like theres no way to just write to one pin.

Im using PORTG pins 0,1, 4 and 5. And also using the other pins like
standards serial ports.

If i write to the PGDR register, i will not affect the serial
trasmission??? I must read the register before and change only the
pins i need?

TIA
------------------------------------



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )


Re: Changing a pin value without affecting the other pins in the port - Steve Trigero - Jun 27 18:39:27 2008

Use BitWrPortI() and BitRdPortI() procedures.
----- Original Message ----
From: Donald Shimoda
To: r...@yahoogroups.com
Sent: Friday, June 27, 2008 3:01:40 PM
Subject: [rabbit-semi] Changing a pin value without affecting the other pins in the port
I dont get how to change the state of a output ping without affecting
all the port.

In PICS, for change in portg the pin 5 you just do some like

PORTC.RC5 = 1;

but with rabbits seems like theres no way to just write to one pin.

Im using PORTG pins 0,1, 4 and 5. And also using the other pins like
standards serial ports.

If i write to the PGDR register, i will not affect the serial
trasmission? ?? I must read the register before and change only the
pins i need?

TIA



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: Changing a pin value without affecting the other pins in the port - Donald Shimoda - Jun 28 14:42:36 2008

--- In r...@yahoogroups.com, Steve Trigero wrote:
>
> Use BitWrPortI() and BitRdPortI() procedures.
>

Thanks a lot.

------------------------------------



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: Re: Changing a pin value without affecting the other pins in the port - Steve Trigero - Jun 30 21:05:36 2008

Each port has a configuration register that you use to configure the port bits to be either inputs or outputs.
Have you configured the port properly? This is pretty basic stuff. Have you read the manual?
----- Original Message ----
From: Donald Shimoda
To: r...@yahoogroups.com
Sent: Monday, June 30, 2008 5:56:59 PM
Subject: [rabbit-semi] Re: Changing a pin value without affecting the other pins in the port
--- In rabbit-semi@ yahoogroups. com, Steve Trigero wrote:
>
> Use BitWrPortI() and BitRdPortI() procedures.
>

Steve, i still cannot make it happens.

My problem is im using a RCM3000 , trying to change to pins (4,5)
only, because the others are in use of ethernet.

Neither config i try work. My code:

WrPortI(PDFR, &PDFRShadow, 0x00);

//Parallel Port x Control Register

WrPortI(PDCR, &PDCRShadow, 0x00);

//PxDCR - Parallel Port x Drive Control Register

//The pin corresponding to this bit, as an output, is driven
high and low.

BitWrPortI(PDDCR, &PDDCRShadow, 4,0);

BitWrPortI(PDDCR, &PDDCRShadow, 5,0);

//PxDDR - Parallel Port x Data Direction Register

BitWrPortI(PDDDR, &PDDDRShadow, 4,1);

BitWrPortI(PDDDR, &PDDDRShadow, 5,1);

// LEDS OFF al inicio

BitWrPortI(PDDR, &PDDRShadow, 4,1);

BitWrPortI(PDDR, &PDDRShadow, 5,1);

TIA



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )

Re: Changing a pin value without affecting the other pins in the port - Donald Shimoda - Jun 30 21:10:09 2008

--- In r...@yahoogroups.com, Steve Trigero wrote:
>
> Each port has a configuration register that you use to configure the
port bits to be either inputs or outputs.
> Have you configured the port properly? This is pretty basic stuff.
Have you read the manual?

Never mind... My error:

> BitWrPortI(PDDCR, &PDDCRShadow, 4,0);

Must be

BitWrPortI(PDDCR, &PDDCRShadow, 0,4);

Best regards.
------------------------------------



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )