|
Hi All,
Device is SAM9XE (9260). I've got a question regarding controlling the initial state of IO line, if it's been assigned to a peripheral.
We are setting registers to drive PIO lines using the Atmel bootstrap. On reset, the lines in question reset to inputs. We want a particular line to be output and controlled by a peripheral (e.g. TD0 on SSC controller) . We are trying to control the initial state driven by a line which is set to be controlled by a peripheral. Can SODR/CODR be used for this?
The question is, does it mean that regardless of whether we will have PIO enabled or using peripheral on a line, can we control the actual initial logic level to be driven on the pad by setting the output and the set/clear registers, given that peripheral is selected for the pad in bootstrap.
If this is the case, then in timing terms, does this mean that the output status registers assert themselves on the pad prior to the output of the chosen peripheral, as it controls the initial state, even if peripheral is selected? Or are the output registers written before the PER/PDR registers?
However, if our reasoning is incorrect and the OSR and ODSR does not assert itself on the pad if PIO is disabled in bootstrap, how do we actually control the initial logic level driven by the line? E.g. set or disable pull-up resisters or some other way?
The datasheet (section 31.4) says: 1. Setting PIO_SODR and PIO_CODR affects PIO_ODSR, which defines the first level driven on the IO line. 2. The IO line can be configured by PIO_OSR and PIO_CODR prior to setting it to be managed by the PIO controller, regardless of whether the pin is configured to be controlled by PIO or assigned to a peripheral function. 3. When the I/0 line is assigned to a peripheral function, the drive of the I/O line is controlled by the peripheral.
Thanks for your help! Richie
|