DSPRelated.com
Forums

McBSP as GPIO.

Started by fraizzer November 22, 2002
Hello

I have a 5402 DSK, and want to use the McBSP1 as a small GPIO port.
Could anyone help me with a short C example on how to setup the
McBSP1 as GPIO and how to control some of the pins as Output's.

Best Regards Jacob



look in the c54x reference set vol 5 (enhanced peripherals), i
believe, and you'll find all the mcbsp registers. there'll be a few
bits to set the mcbsp for gpio and another few bits to read/write to
the pins.
specifically look at page 2-96 (p121).

you may also want to read the chip support library api reference
guide. both of these documents should show up if you search for them
at www.ti.com

--- In c54x@y..., "fraizzer" <jacob@j...> wrote:
> Hello
>
> I have a 5402 DSK, and want to use the McBSP1 as a small GPIO port.
> Could anyone help me with a short C example on how to setup the
> McBSP1 as GPIO and how to control some of the pins as Output's.
>
> Best Regards Jacob





Thank you. It lead me to this:

//Port nr. is CLKRP = 0, CLKXP = 1, FSRP = 2, FSXP = 3.
MCBSP_SUBREG_BITWRITE(1, PCR_SUBADDR, iPortNr, 1, 0);

MCBSP_SUBREG_BITWRITE(1, PCR_SUBADDR, iPortNr, 1, 1);

For setting and reseting the pins in GPIO mode. I chose to setup the
McBSP as GPIO from the DSP/BIOS configuration mannager.

/Jacob

>>>>> "Lucy" == Lucy Jordan <> writes:

Lucy> look in the c54x reference set vol 5 (enhanced peripherals), i
Lucy> believe, and you'll find all the mcbsp registers. there'll be a
Lucy> few bits to set the mcbsp for gpio and another few bits to
Lucy> read/write to the pins. specifically look at page 2-96 (p121).

Lucy> you may also want to read the chip support library api reference
Lucy> guide. both of these documents should show up if you search for
Lucy> them at www.ti.com

Lucy> --- In c54x@y..., "fraizzer" <jacob@j...> wrote:
>> Hello
>>
>> I have a 5402 DSK, and want to use the McBSP1 as a small GPIO port.
>> Could anyone help me with a short C example on how to setup the
>> McBSP1 as GPIO and how to control some of the pins as Output's.
>>
>> Best Regards Jacob