Show Posts
Pages: [1] 2 3 ... 9
1  Products / Arduino Due / Re: Interested in ARM arquitecture on: April 12, 2014, 02:55:11 am
Gericom, thank you for your answer,

Maybe it could be programmed using Atmel Studio 6.

I think this link is interesting for someone trying to learn ARM architecture:
http://rcarduino.blogspot.com.es/2012/09/how-to-view-arduino-assembly.html

Probably. Personally I don't find arm (the due uses thumb only, but it's quite the same) very difficult. You may want to use this as a simple reference: http://simplemachines.it/doc/arm_inst.pdf
It is for arm, but as I said, it may be partly used for thumb aswell.
2  Products / Arduino Due / Re: Interested in ARM arquitecture on: April 11, 2014, 11:02:53 am
Hello, I am interested about learning ARM architecture and how to program it.

Well, I have several questions:

Can I program Arduino Due in Assembly language ?
Could you tell me any good tutorial about it ?
Do you know any good book or tutorial about programming ARM or its architecture ?

A good answer would be very appreciated
Yes, you can program the arduino due in assembly language, but only using inline asm by default. (I think that using .s files might be possible as well with some little changes in the ide)
3  Products / Arduino Due / Re: Storing data on Arduino DUE on: March 21, 2014, 09:08:26 am
Did you read the bit where it says :- 96 KBytes of SRAM
That means that the Due as most ram than most Arduino have flash / eeprom / sram put together.
o.k 96k of ram , 5 seconds , 4 sensors
4 sensors at 32 bits each ( 4 bytes )  4 * 4 = 16 byte
96k and say 80k usable ? ( 80 * 1024 )  / 16 = 5120 * 5 seconds  = 25600 seconds of 4 sensor data.
25600 / 60 / 60 about 7 hours of data , without storing it , And you can double that for you only need 16 bit per cell .
Yea, I know the arduino due got not a lot of ram, but I am not sure if storing in the flash is a good idea. Maybe you can better get an external memory chip the sam3x can interface natively. (Look in the datasheet)
4  Products / Arduino Due / Re: Storing data on Arduino DUE on: March 20, 2014, 02:05:48 pm
Hi,
I wanted to store information on the arduino DUE board. I want to store the readings taken from four different types of sensors every 5s. How can I accomplish this, as most of the examples shown are in relation to other boards? How do I store these values into the FLASH memory? Any help or guidance would be appreciated.
Why do you want to save in flash?
5  Products / Arduino Due / Re: Nothing appears on arduino DUE screen on: March 13, 2014, 08:33:33 am
When using the native port, do it like this:
Code:
void setup()                    // run once, when the sketch starts
{
  SerialUSB.begin(9600);           // set up Serial library at 9600 bps
}

void loop()                       // run over and over again
{
 SerialUSB.println("Hello world!");        // prints hello with ending line break                             
}
6  Products / Arduino Due / Re: Nothing appears on arduino DUE screen on: March 12, 2014, 01:47:43 pm
If you use the native port you muste use "SerialUSB" for communication with the computer.
Exactly. Thats why I asked.
7  Products / Arduino Due / Re: ADC - analogRead at high frequency (1 MHz) on Arduino DUE on: March 12, 2014, 01:46:49 pm
Here you can find the datasheet of the chip: www.atmel.com/Images/doc11057.pdf
8  Products / Arduino Due / Re: Nothing appears on arduino DUE screen on: March 11, 2014, 02:56:02 pm
Did you connect using programming or native port?
9  Products / Arduino Due / Re: ADC - analogRead at high frequency (1 MHz) on Arduino DUE on: March 11, 2014, 01:38:54 pm
I think you can only get 1MHz using dma.
10  Products / Arduino Due / Re: Creating a Sinusoidal PWM signal for H-Bridge Control on: March 06, 2014, 01:39:10 pm
Maybe you could use dma or a timer interrupt.
11  Products / Arduino Due / Re: Due Flash Memory on: February 08, 2014, 03:55:05 pm
Hello,

I have a collection of short music samples and effects for a board game. The sounds don't change and would ideally be included with a sketch at compile time.

I would like to burn then into the DUE from the IDE and then read the audio data from FLASH whilst the program is running.

Is this possible?

Thanks
Pascal
You need to do it like this:
Code:
const byte sound[something] =
{
Data here
};
12  Products / Arduino Due / Re: Composite Video Generating on: December 19, 2013, 02:05:26 am
Hi There.
I just got myself an Arduino due today and thought what better way to try it out then with your cool graphics smiley
Do you have a library ? or any code I can run. Possibly a circuit diagram if it's not to much trouble of course.
You did a fantastic job on your project, well done
Thanks
BlackSnake
Thanks, I have a sketch you can run (it consists out of multiple files) and I will make a schematic. I will do this when I have time to do so.
13  Products / Arduino Due / Re: Composite Video Generating on: December 13, 2013, 01:05:47 pm
I have started working on this a few days ago, and the video op-amp is not needed anymore now. It turned out that the the voltage ratios were not correct. I fixed it, and in combination with a new and better r2r ladder, it works much better. I also switched from 8 to 5 bits, cause that's just more suitable for a 1% r2r ladder.

There are still some color phase errors, but since pal uses phase alternation, those errors are not much noticable.
14  Products / Arduino Due / Re: Reading analog channel MANUALLY on: December 11, 2013, 01:37:56 am
We were told that only the Channel Enable Register, Control Register and MR register is needed to make it work and we can then read from the LCDR or CDRx registers.

I noticed yours have things like startup time, settling time, the adc clock etc. We assumed those are unecessary to tamper with because the default should work too.

We don't have much experience with the terminology used in these kind of things so it's difficult to figure out what does what. That is why I need to know which registers are to be modified.

If you don't mind writing an example with direct values, i.e. remove any function call and replace it with a direct value, it would help us a lot.

Even if you only explained what the different things like settling, startup time and the others affect would help a lot too!
I will try to make a good example for you soon. But in the meanwhile, just take a look at the adc dection of this document: http://www.atmel.com/images/doc11057.pdf All registers are described here.
15  Products / Arduino Due / Re: Reading analog channel MANUALLY on: December 10, 2013, 12:15:04 pm
-snip-

-Chris

We have been sitting with it for AT LEAST 10 hours trying to solve it, we asked the mentor 3 times already and there is no one else to ask because we're basically ahead of everyone else. What we received as information to what we are supposed to do in order to read the value is to:
Code:
Select/Enable channel with the ADC_CHER registry
Set the ADC clock to 14 MHZ with the ADC_MR registry
Start a conversion with the ADC_CR registry
Wait until ADC_SR's DRDY bit is 1
Read the converted data with either the ADC_LCDR or the ADC_CDRx register

We've tried a lot of different ways to approach this. We have tried setting the values that the adc_init and adc_config functions sets above in the other post, reading the internal temp sensor, turning on freerun mode.... We have tried so many different variations that I can't even remember all of them.

I am not asking anyone to do our school work for us. I am searching for guidance about exactly which registers we need to change in order to make the ADC work. We are not two stupid guys and are capable enough to understand what the different registers do, once we know which ones we need to use.

You can imagine how frustrated we get when all we get from hours of googling is "use AnalogRead".
We only need a small sample of code that is a MUST for using ADC. We obviously need to understand it because we're going to use it for temperature sensors and what not.
This is the adc sampling code I use for my USB Audio Interface. It actually contains everything for reading ADC values.
Code:
#include <Arduino.h>
#include <USB/USBAPI.h>
#include <USB/USBDesc.h>
#include <USB/Audio.h>

boolean B = false;

void startTimer(Tc *tc, uint32_t channel, IRQn_Type irq, uint32_t frequency) {
  pmc_set_writeprotect(false);
  pmc_enable_periph_clk((uint32_t)irq);
  TC_Configure(tc, channel, TC_CMR_WAVE | TC_CMR_WAVSEL_UP_RC | TC_CMR_TCCLKS_TIMER_CLOCK1);
  uint32_t rc = VARIANT_MCK/2/frequency; //128 because we selected TIMER_CLOCK4 above
  TC_SetRA(tc, channel, rc/2); //50% high, 50% low
  TC_SetRC(tc, channel, rc);
  TC_Start(tc, channel);
  tc->TC_CHANNEL[channel].TC_IER=TC_IER_CPCS;
  tc->TC_CHANNEL[channel].TC_IDR=~TC_IER_CPCS;
  NVIC_EnableIRQ(irq);
}

void setup() {
  InitAdc();
  AUDIO_InitBuffers(512 * 10);
  while(true)
  {
    if(USBD_GetCurrentInterface() == 1) break;
  }
  udd_enable_endpoint_interrupt(AUDIO_ENDPOINT_DATA & 0xF);
  udd_enable_in_send_interrupt(AUDIO_ENDPOINT_DATA & 0xF);

  startTimer(TC1, 0, TC3_IRQn, 48000);
}

void InitAdc()
{
  adc_init(ADC, 84000000, 84000000/2, 0);
  adc_configure_timing(ADC, 1, ADC_SETTLING_TIME_3, 0);
  adc_disable_all_channel(ADC);
  adc_enable_channel( ADC, (adc_channel_num_t)g_APinDescription[A0].ulADCChannelNumber );
  adc_enable_channel( ADC, (adc_channel_num_t)g_APinDescription[A11].ulADCChannelNumber );
  ADC->ADC_MR &= ~ADC_MR_FWUP;
  ADC->ADC_MR |= ADC_MR_FWUP_OFF;
  ADC->ADC_MR &= ~ADC_MR_LOWRES;
  //ADC->ADC_MR |= ADC_MR_LOWRES_BITS_10;
  ADC->ADC_MR &= ~ADC_MR_FREERUN;
  ADC->ADC_MR |= ADC_MR_FREERUN_ON;
  ADC->ADC_MR &= ~ADC_MR_PRESCAL_Msk;
  ADC->ADC_MR |= ADC_MR_PRESCAL(0);
  ADC->ADC_MR &= ~ADC_MR_SLEEP;
  ADC->ADC_MR |= ADC_MR_SLEEP_NORMAL;
  ADC->ADC_MR &= ~ADC_MR_STARTUP_Msk;
  ADC->ADC_MR |= ADC_MR_STARTUP_SUT0;
  ADC->ADC_MR &= ~ADC_MR_ANACH;
}

void loop() {
 
}

void TC3_Handler()
{
  TC_GetStatus(TC1, 0);

  int data1 = *((uint32_t*)0x400C006C);
  int data2 = *((uint32_t*)0x400C0084);
  //12288 is for centering. Math: (32767 / 2 + 32767 / 4) / 2
  short val1 = map(data1, 0, 4095, -32767, 32767) + 12288;
  short val2 = map(data2, 0, 4095, -32767, 32767) + 12288;

  AUDIO_WriteSample((uint16_t)val1, (uint16_t)val2);
}
I didn't edit anything. If you want a more clean example, just ask.
Pages: [1] 2 3 ... 9