Clocks and IO Pins on ATSAM bsp

Isaac Gutekunst 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.

Isaac

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[5] &= ~(PMC_PCK_CSS_Msk);
>   PMC->PMC_PCK[5] |= ((2 << PMC_PCK_CSS_Pos) & PMC_PCK_CSS_Msk);
>
>   PMC->PMC_PCK[5] &= ~(PMC_PCK_PRES_Msk );
>   PMC->PMC_PCK[5] |= ((11 << PMC_PCK_PRES_Pos ) & PMC_PCK_PRES_Msk);
>
>
>   PMC_EnablePeripheral(ID_MCAN1);;
>   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.
>
>
> Thanks,
>
> Isaac
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clock.c
Type: text/x-csrc
Size: 4536 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/users/attachments/20160610/616490b0/attachment.bin>


More information about the users mailing list