Multimodule has a pulldown resistor and does not work with open drain, use push pull instead (#4808)
This commit is contained in:
committed by
Bertrand Songis
parent
2b41ba94ff
commit
54c1f22312
@@ -163,21 +163,25 @@ void disable_ppm(uint32_t port)
|
|||||||
// TD is on PA17, peripheral A
|
// TD is on PA17, peripheral A
|
||||||
void init_ssc(uint8_t baudrateDiv1000)
|
void init_ssc(uint8_t baudrateDiv1000)
|
||||||
{
|
{
|
||||||
Ssc * sscptr;
|
Ssc *sscptr;
|
||||||
|
|
||||||
PMC->PMC_PCER0 |= 0x00400000L; // Enable peripheral clock to SSC
|
PMC->PMC_PCER0 |= 0x00400000L; // Enable peripheral clock to SSC
|
||||||
|
|
||||||
configure_pins(PIO_PA17, PIN_PERIPHERAL | PIN_INPUT | PIN_PER_A | PIN_PORTA);
|
configure_pins(PIO_PA17, PIN_PERIPHERAL | PIN_INPUT | PIN_PER_A | PIN_PORTA);
|
||||||
|
|
||||||
sscptr = SSC;
|
sscptr = SSC;
|
||||||
sscptr->SSC_THR = 0xFF; // Make the output high.
|
sscptr->SSC_THR = 0xFF; // Make the output high.
|
||||||
sscptr->SSC_TFMR = 0x00000027; // 0000 0000 0000 0000 0000 0000 1010 0111 (8 bit data, lsb)
|
sscptr->SSC_TFMR = 0x00000027; // 0000 0000 0000 0000 0000 0000 1010 0111 (8 bit data, lsb)
|
||||||
sscptr->SSC_CMR = Master_frequency / (1000*baudrateDiv1000*2);
|
sscptr->SSC_CMR = Master_frequency / (1000 * baudrateDiv1000 * 2);
|
||||||
sscptr->SSC_TCMR = 0;
|
sscptr->SSC_TCMR = 0;
|
||||||
sscptr->SSC_CR = SSC_CR_TXEN;
|
sscptr->SSC_CR = SSC_CR_TXEN;
|
||||||
|
|
||||||
#if defined(REVX)
|
#if defined(REVX)
|
||||||
PIOA->PIO_MDER = PIO_PA17; // Open Drain O/p in A17
|
if (IS_MODULE_MULTIMODULE(EXTERNAL_MODULE)) {
|
||||||
|
PIOA->PIO_MDDR = PIO_PA17; // Push Pull O/p in A17
|
||||||
|
} else {
|
||||||
|
PIOA->PIO_MDER = PIO_PA17; // Open Drain O/p in A17
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
PIOA->PIO_MDDR = PIO_PA17; // Push Pull O/p in A17
|
PIOA->PIO_MDDR = PIO_PA17; // Push Pull O/p in A17
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user