[riot-notifications] [RIOT-OS/RIOT] SAM3: macro LED0_TOGGLE not working (#7613)
notifications at github.com
Sun Sep 17 13:09:53 CEST 2017
The LED0_TOGGLE macro for the **arduino-due (SAM3XE)** uses he PIO_ODSR register to toggle led status
However this register is read-only unless the corresponding bit in **PIO_OWER** is set.
> 31.5.5 Synchronous Data Output
[...] the PIO Controller offers a direct control of PIO outputs by single write access to PIO_ODSR (Output Data Status Register). Only bits unmasked by PIO_OWSR (Output Write Status Register) are
written. The mask bits in PIO_OWSR are set by writing to PIO_OWER (Output Write Enable Register) and cleared by writing to PIO_OWDR (Output Write Disable Register).
[SAM3XE datasheet pg. 623 p. 31.5.5](http://www.atmel.com/Images/Atmel-11057-32-bit-Cortex-M3-Microcontroller-SAM3X-SAM3A_Datasheet.pdf)
This fix enables the PIO_OWSR for **all** pins in PIOB, I don't know whether this is the intended behaviour or not. Other possible solutions could be:
- Enabling PIO_OWSR only for LED0 (0x08000000).
- Changing the macro so it uses only SODR and CODR registers.
- Adding a note on the second tutorial (wich uses this macro)
You can view, comment on, or merge this pull request online at:
-- Commit Summary --
* Enable all Synchronous Data Output for PIOB by default
-- File Changes --
M cpu/sam3/cpu.c (3)
-- Patch Links --
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications