Clocks and IO Pins on ATSAM bsp
isaac.gutekunst at vecna.com
Fri Jun 10 15:20:34 UTC 2016
I've attached a super rough, probably buggy way to print some clock information, and attempt to configure the clocks related to CAN1 to reasonable values. This may be helpful in understanding where I am in this process.
On 06/10/2016 11:15 AM, Isaac Gutekunst wrote:
> Hi Everyone,
> I'm moving along with our project here at Vecna, and am working to bring up the MCAN controller on the ATSAMV71Q21 processor. I'm having a fun time figuring out the clock tree, and bringing the peripheral up.
> Are there any recommended ways of configuring all the clocks and enabling the GPIO pins to bring up a peripheral?
> I'm doing an awkward mix of calling functions provided by Atmel, e.g. PIO_Configure(pinsMcan1, PIO_LISTSIZE(pinsMcan1)); (wrapped in a #ifndef __rtems__ in mcan.c), and twiddling bits in the variou PMC control registers: e.g.
> PMC->PMC_PCK &= ~(PMC_PCK_CSS_Msk);
> PMC->PMC_PCK |= ((2 << PMC_PCK_CSS_Pos) & PMC_PCK_CSS_Msk);
> PMC->PMC_PCK &= ~(PMC_PCK_PRES_Msk );
> PMC->PMC_PCK |= ((11 << PMC_PCK_PRES_Pos ) & PMC_PCK_PRES_Msk);
> PMC->PMC_PCR |= (PMC_PCR_CMD);
> PMC->PMC_PCR |= (PMC_PCR_PID(ID_MCAN1));
> So far, I haven't gotten the peripheral to work, but that's a matter of struggling forward. I'm curious if anyone has already figured any of this out, and can offer advice.
> users mailing list
> users at rtems.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4536 bytes
Desc: not available
More information about the users