Keil Logo

C51: Using Multi-Function Pins on ATMEL AT89C51RD2


Information in this article applies to:

  • C51, all versions

QUESTION

I am using the AT89C51RD2 microcontroller and I see in the data sheet of this controller that some peripherals such as SPI are sharing the same I/O Pin with other functions like Timer 2 and PCA.

Port 1 shares multiple functions as shown in the list below:

  • P1.0: I/O; T2: Timer/Counter 2 external count input/Clockout are on same pin.
  • P1.1: I/O; T2EX: Timer/Counter 2 Reload/Capture/Direction Control; SS: SPI Slave Select are on same pin.
  • P1.3: I/O; CEX0: Capture/Compare External I/O for PCA module 0 are on same pin.
  • P1.4: I/O; CEX1: Capture/Compare External I/O for PCA module 1 are on same pin.
  • P1.5: I/O; CEX2: Capture/Compare External I/O for PCA module 2; MISO: SPI Master Input Slave Output line are on same pin.
  • P1.6: I/O; CEX3: Capture/Compare External I/O for PCA module 3; SCK: SPI Serial Clock are on same pin.
  • P1.7: I/O; CEX4: Capture/Compare External I/O for PCA module 4; MOSI: SPI Master Output Slave Input line are on same pin.

I want to use the PCA, Timer 2 as well as SPI in my application, but I am confused as to how we can use all three functionalities when they are sharing the same I/O Pin?

ANSWER

Sorry, but the pin assignment of the peripherals limits the use. It is not possible to use all three pin functions at the same time. However, Atmel has released enhanced devices. For example the AT89C51ID2 has the SPI pins available as separate functions in the PLCC44 package. In this way the limitations are reduced.

MORE INFORMATION

  • Atmel Datasheets

Last Reviewed: Thursday, February 25, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.