Can i use the code written for arduino mega board directly for the nRF51822 in arduino IDE?

satishakula gravatar image

asked 2016-12-02 06:46:47 +0100

updated 2016-12-02 06:54:19 +0100

initially we developed code for arduino mega board but now we want to use the nRF51822 soc,so how i can utilize my arduino code for nRF51822 ....i have gone through the some topics but there no clarity about code conversion to nrf51822.

thanks & regards, satish

edit retag flag offensive close delete report spam

1 answer

Sort by » oldest newest most voted
rogerclark gravatar image

answered 2016-12-02 11:53:30 +0100

AFIK there is no official Arduino "core" for the nRF51, however Sandeep's core is very good


But... its unlikely that all of your Arduino Mega core will compile for the nRF5 series processors as the internal processor architecture is ARM rather than AVR and its a 32 bit processor rather than an 8 bit.

Additionally, if you use any external libraries which directly interface with AVR hardware e.g. the hardware timer etc, the code will not compile at all, as the nRF5 peripheral hardware is completely different.

All that being said, if you just run standard libs etc, there is a reasonable chance your code will port to the nRF5 series without too many problems.

edit flag offensive delete publish link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

Question Tools

1 follower


Asked: 2016-12-02 06:46:47 +0100

Seen: 126 times

Last updated: des. 02 '16