Use ERASE pin as IO

Discussion around product based on ARM Cortex M4 core.

Moderators: nferre, ncollot

pitdibi
Posts: 4
Joined: Tue Dec 23, 2014 2:54 pm

Use ERASE pin as IO

Tue Dec 23, 2014 3:28 pm

I've a board with ATSAM4E16C. In this board there is a button connected to ERASE PIN (PB12). I would use it as input but if I push button (connecting to VDD) after about 200 ms the flash is erased. Why?
pitdibi
Posts: 4
Joined: Tue Dec 23, 2014 2:54 pm

Re: Use ERASE pin as IO

Tue Dec 23, 2014 3:51 pm

I solved the problem by inserting the following line
REG_CCFG_SYSIO |= CCFG_SYSIO_SYSIO12;
which sets the function of the pin
bluewildebeest0
Posts: 1
Joined: Tue Feb 03, 2015 2:26 pm

Re: Use ERASE pin as IO

Thu Feb 05, 2015 1:53 pm

REG_CCFG_SYSIO |= CCFG_SYSIO_SYSIO12;

Works well when in main(), thanks, but I use the pin as default high.
Thus, when power is cycled, flash is erased again...
Where is the best place to place this code?  :?
I have tried in other header files, as well as matrix.h, no luck.

Return to “SAM4 Cortex-M4 MCU”

Who is online

Users browsing this forum: No registered users and 3 guests