Here comes the Due

Here it is after a long and patient wait! Short long story: I recorded my name on various supplier’s web sites which were all running out of stock. In the middle of December I got the feedback that one of them had a couple of Due available, but as I was away from my desk I could not place my order in time (blah!). Ultimately, while touring my favorite local suppliers I pointed out that Snootlab had a couple of them in stock. Without the least hesitation I placed an order for two, that I got a few days later. Congratulation Frederic, It is not fully clear how you managed to pass by major suppliers, the fact is that you made it!

due

And now comes the fun with this brand new baby.  It is so different from the UNO/MEGA series and it will require quite a strong mental investment in order to get deep inside this new device.

Just figure out how different is the raw code writing by reading the rewritten blink code!

/*
	Blink the DUE board which features an Atmel SAM3X8E ARM Cortex-M3 CPU
	Turns on an LED on for one second, then off for one second, repeatedly.
 */

uint32_t _mask = (1u << 27); /* Pin mask */
Pio* _pio = (Pio *)0x400E1000U; /* Parallel IO */

void setup() 
{                   
	_pio->PIO_IDR = _mask; /* Disable interrupts on the pin (as a precaution) */
    _pio->PIO_MDDR = _mask ; /* PIO Multi-driver Disable Register */
	_pio->PIO_OER = _mask ; /* Output Enable Register */
	_pio->PIO_PER = _mask ; /* PIO Enable Register */
}

void loop() 
{
	_pio->PIO_SODR = _mask; /* Set Output Data Register, turns led on */  
	delay(1000);              
	_pio->PIO_CODR = _mask; /* Clear Output Data Register, turns led off */  
	delay(1000);              
}

This brings me to the observation that the Arduino team made a tremendous work in order to keep the DUE programming as simple as 1, 2, 3, keeping one single IDE for all boards. There is still a lot to do in order to get the most from this board, but its dedicated forum activity shows that it will not take long to the Arduino community to produce bright code and applications again. Code and documentation, such as the brilliant pin out prepared by the “Gray nomad”, which you can see on the background of the above picture.

 

Leave a Reply

You must be logged in to post a comment.