Show Posts
Pages: 1 ... 10 11 [12] 13 14 ... 32
166  Products / Arduino Due / Re: Arduino Due in sleep mode on: August 29, 2013, 08:52:28 am
Hello elnhege,

The sleep mode in the SAM3X8E (Arduino's Due MCU) as one of the three Low Power modes, it's based on the deep-sleep mode of its core(Cortex-M3). Its implementation is done in the PMC (Power Management Controller) register via Wait for Interrupt (WFI) or Wait for Event (WFE) instructions. There is also a deep sleep function using the SCR register. You can find information about this sleep mode in the doc11057.pdf, sections 5.5.1 and 12.8.

If you want to explore more the sleep mode functions in the Arduino Due library, you can check the pmc.c file (lines 972-982).


167  Products / Arduino Due / Re: ATmega16u2 Code on: August 29, 2013, 06:48:51 am
Hello CrazyCreator,

Please, check this reply #25 of this thread:

168  Products / Arduino Due / Re: problems with Arduino Due on: August 28, 2013, 09:02:48 pm
Hello giubio51,
Normally, when you wait for serial data is to read it, but if you only want to write 'W' each time a character is sent via serial, a good way to empty Serial.available() is using follows:

// Setup (executed only one time
void setup(void)
  Serial.begin(9600);         // Baud Rate test may values as 1200, 115200, 9600 etc..., no one works
  while (!Serial);
  pinMode(13,OUTPUT);    // This pin is ON at power on (?) and it goes on every time I send a byte with the PC, I can reset it via pin input 10
  pinMode(10,INPUT);       // Just for test, used to resetpin output 13 (led) that is on by it self (?)
  Serial.print("K");            // This print is in setup loop, then sent only one time, but it appears time by time when I send bytes from the PC

// Main Loop
void loop(void)
  if(Serial.available() >0)
  if (digitalRead(10) == 0) {digitalWrite(13,0);}

169  Products / Arduino Due / Re: __attribute__((packed)) is failing in Arduino 1.5.2 IDE (On Due board) on: August 28, 2013, 07:30:06 pm
Yep. Compilation without complaints. I know what that means. I also do not imagine myself crafting my code with asserts trying to catch layout errors only because my program misbehaves at run time. It's like chasing the white rabbit. That has been always the thing with C/C++ compilers. They are like old blind and mute Lamas to whom we must be attentive, in silence, waiting for any sign like: error 0x45AC00000 ITIPHHTEMETEIROEBE. Regards! 
170  Products / Arduino Due / Re: __attribute__((packed)) is failing in Arduino 1.5.2 IDE (On Due board) on: August 27, 2013, 09:30:24 pm
Hello haturi,
I think you are facing a syntax issue. Here the corrected code:

void setup() {
  // put your setup code here, to run once:
typedef struct __attribute__((packed)) quest_st
    uint32_t    kern;
    uint8_t     chCount;

        uint8_t asAmpli;
            uint8_t dir   : 4;
            uint8_t curve : 4;
    } uAmpli;

        uint8_t asForce;
            uint8_t amount  : 5;
            uint8_t axis    : 3;
    } uForce;
}   QUEST;

int  ss;
QUEST myQuest;
char buf[ 80];
  // Open serial communications and wait for port to open:
  Serial.println("Program start.");

  if( &ss != NULL)
    ss = sizeof( QUEST);
  sprintf( &buf[0], "\n sizeof( QUEST) = %ld  sizeof(myQuest) = %ld"
    "  sizeof( struct quest_st) = %ld", ss, sizeof( myQuest), sizeof( struct quest_st));
  Serial.println( &buf[0]); 

void loop() {
  // put your main code here, to run repeatedly:

Program start.

 sizeof( QUEST) = 7  sizeof(myQuest) = 7  sizeof( struct quest_st) = 7

171  Products / Arduino Due / Re: Is bossac checking the CIDR of the arduino DUE on: August 27, 2013, 12:00:15 pm
Hello kingmail,
Bossac is not only a boot-loader tool for the SAM3X8E but supports all of Atmel's known flash-based SAM devices. I believe bossac checks automatically the CIDR of the MCU. Just try:

bossac.exe --port=COM1 -U true -i

I used comm. port 1 as an example. Remember to change to your current COM port.
Also change to 'false' if your are connecting to the USB-to-TTL serial chip.

You should program your sam3x8c using bossac in the same way you do it for Arduino Due.
Anyway, I have a 3x8c system at home and I can try some tests tonight.


<< Do not use the Arduino IDE to compile/program your SAM3X8C based board at least you have the variant files redefined for the 100-pin package of SAM3X8c. I am not sure about the uart interface settings but may be you will need to redefine them too.
I would recommend you to use Atmel Studio 6.1 where you can create bare minimum project templates for the SAM3X8C which will automatically generates the 100-in/out pins and other utily files. Just let me know where you are in your project (stage).
You can always count with the at91 Atmel tech support team after generate a ticket. >>
172  Products / Arduino Due / Re: Arduino Due and ADK 2012 on: August 26, 2013, 03:05:50 pm
DO NOT connect directly your speaker to the DAC pin.
Please, read and follow the following updated tutorial.

173  Products / Arduino Due / Re: Why the sketch size and amount of RAM used by DUE is more than MEGA. on: August 26, 2013, 10:16:11 am
Give their different MCU's, Due (32-bit Cortex-M3 based SAM3X8E) and Mega ( 8-bit AVR RISC ATmega2560), they use a different version of the same programming GNU tool chain (compiler, liker, additional utilities). AVR for Mega and ARM-none-eabi for Due, which means that the coding is also different. 32-bit vs 8-bit program instructions and memory locations means also different coding sizes. Regards! 
174  Products / Arduino Due / Re: Another I2C Thread on: August 24, 2013, 05:59:41 pm
Hi Guy,

I know there are several post about using the I2C bus on the DUE however; there doesn't seem to be a clear answer...

Has anyone managed to get any I2C device to work on the DUE yet?

Hello adamatcooranbong,

Above all, I am very happy you mentioned the I2C and Due. You are rigth about certain confusion about re-conciliate them. Indeed, I was encouraged by some friends to start a new post here trying to present a simple method about how to interconnect Due with some I2C device.

I take the advantage to clarify that regarding the Philips' bus, from the Arduino Due point of view, we talk about TWI (Two-wire Interface) instead of I2C. Due's microcontroller (SAM3X8E) has two TWI interfaces that are fully compatible with the I2C devices with some exceptions like: the START BYTE and Slope control and input filtering, AFAIK, are not supported by Due. Also, these two TWI buses keep the same pin names (SDA)(SCL)(SDA1)(SCL1).

Which is more important, there is a very good TWI library (around 20 functions) for Due and several examples (i.e. digital_potentiometer) that could help to understand better how Due works interfacing I2C devices. I believe it is more about to play with it.

If you have a I2C device you want to connect with Due, please, let me know about it and I believe we can make them work together. Regards!
175  Products / Arduino Due / Re: Internal RTC with back up battery on: August 23, 2013, 04:30:20 pm
Could you show the connection between power supply (3.3v), backup battery and VDDBU pin? Thanks.
176  Products / Arduino Due / Re: change ADC clock on: August 23, 2013, 04:28:42 pm
In a dedicated logic, given your current ADC clock (291666Hz), you should read the analog input 500 times per cycle using delayMicroseconds(11) between readings.
177  Products / Arduino Due / Re: Internal RTC with back up battery on: August 23, 2013, 04:06:26 pm
No, i connected battery directly to the VDDBU.
Is this  can be problem?

BAT54c is more a protection device for the battery backup system, but here is your problem:The Arduino Due reset pin is the NRSTB and not NRST, thus, every time that NRSTB lost power, it will reset the SAM3X8E Backup region (RTC, RTT and Supply Controller). This wouldn't be the case if NRST were connected to the reset button, because NRST does not reset the Backup region. This is one of the design changes to be done by the Ardino team in future Due revisions.  

I also want to ask, is this scheme, no 1 pin of bat54c is connected to the 3.3 v. what is purpose of this? what will be done if connected or not connected?

I assume your backup battery is not rechargeable. and as I stated before, the BAT54c (schottky barrier) has a protective role, keeping the battery to be discharged in case no 1 drops below 3.3v. It also protects the battery in the opposite case when the power supply voltage is above 3.3v. Additionally, BAT54c has a low voltage drop. Regards!

178  Products / Arduino Due / Re: change ADC clock on: August 23, 2013, 03:19:49 pm
I overlooked you quote from the Atmel's manual but I believe you already gave yourself the answer: ADC can't be 25KHz. ADC minimum possible value is MCK/255 and the maximum is MCK/2. For 25000, your Master Clock Frequency should be 6375000. The function sysclk_get_main_hz() gives you the MCK for the SAM3X8E which is 84000000 (12nS). Thus, your desire ADC clock can be reached. May be we could help you a bit more if you tell us why you need 25KHz for your ADC clock? Regards!
179  Products / Arduino Due / Re: Internal RTC with back up battery on: August 23, 2013, 02:43:26 pm
RTC oscillator already assembled and connected battery to VDDBU.

Hello feveran, just in case, verify that in your battery backup system, the VDDBU pin is powered from the 3.3V and the backup battery via a dual Schottky diode D1, as follows.

180  Products / Arduino Due / Re: change ADC clock on: August 23, 2013, 01:00:06 pm
  ACTUAL_ADC_CLK = adc_get_actual_adc_clock(ADC, SystemCoreClock/11.6666);
Pages: 1 ... 10 11 [12] 13 14 ... 32