Configuring pins as open-drain on a ATUC256L3U

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

I am trying to communicate via TWI with a IMU-chip. The problem is to configure some pins as open-drain. For the pins PA04,PA10,PB20 and PB21 I cannot

find out how configure them. There is no option in the GPIO description. Do you have a hint  or an idea hot do it?

 

Thanks in advance

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe open-drain is not available as an option - what makes you think that it should be?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The following sentences in the extended data sheet:

 

The TWALM, TWD, and TWCK pins may be multiplexed with I/O Controller lines. To enable the
TWIM, the user must perform the following steps:
• Program the I/O Controller to:
– Dedicate TWD, TWCK, and optionally TWALM as peripheral lines.
– Define TWD, TWCK, and optionally TWALM as open-drain.

 

You can dedicate PA04 & PB21 as TWCK and PA10 & PB20 as TWD.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It appears that the open-drain feature was implemented in the modules that need it (eg TWIM, TWI, PWMA), instead of in the GPIO module.
(the UC3A0/1 had an ODMER register in the GPIO but the datasheet said it wasn't implemented and it appears to have been removed from subsequent UC3 processors)


Near the front of the datasheet in the 'I/O Line Considerations' section it says that the TWI pins are open-drain when in TWI mode.
I've used TWIM on a UC3Lxxx so I think you don't need to worry about configuring the pins for open-drain operation.

Last Edited: Tue. Apr 11, 2017 - 10:20 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mikech wrote:
It appears that the open-drain feature was implemented in the modules that need it (eg TWIM, TWI, PWMA), instead of in the GPIO module.

Sounds similar to the SAM D parts - quite possibly, it's where they got it from ?