Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[AVR/ARM]Seeking Advice regarding switching to 32bit µC and register manipulation etc

Status
Not open for further replies.

David_

Advanced Member level 2
Joined
Dec 6, 2013
Messages
573
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,308
Location
Sweden
Activity points
12,220
Hello.

I started out with Arduino and 8bit ATmega328/2560 and as I had just learned how to change registers to do what I wanted when I bought a Arduino Due with the SAM3X8E 32bit ARM architecture and as I went through the datasheet I quickly saw the enormous advantages from
"The Peripheral DMA Controller (PDC) transfers data between on-chip serial peripherals and the
on- and/or off-chip memories. The link between the PDC and a serial peripheral is operated by
the AHB to APB bridge." for one and there's lots and lots more.

I am not very knowledgeable regarding software and by all measures I am a beginner but I am just about to ditch Arduino for Atmel Studio 6 but I have some trouble understanding how to program this new µC, I have found some examples online but the don't explain anything and I can't find any explanation, for example the following is snippets from a code from a arduino file but the commands used, how do I find more about them and there usage?
Code:
 // Enable parallel access on PIO output data registers
  PIOA->PIO_OWER = 0xFFFFFFFF;
  PIOB->PIO_OWER = 0xFFFFFFFF;
  PIOC->PIO_OWER = 0xFFFFFFFF;
  PIOD->PIO_OWER = 0xFFFFFFFF;


  // Initialize CAN pins
  PIO_Configure(
    g_APinDescription[PINS_CAN0].pPort,
    g_APinDescription[PINS_CAN0].ulPinType,
    g_APinDescription[PINS_CAN0].ulPin,
    g_APinDescription[PINS_CAN0].ulPinConfiguration);
  PIO_Configure(
    g_APinDescription[PINS_CAN1].pPort,
    g_APinDescription[PINS_CAN1].ulPinType,
    g_APinDescription[PINS_CAN1].ulPin,
    g_APinDescription[PINS_CAN1].ulPinConfiguration);

  // Initialize Analog Controller
  pmc_enable_periph_clk(ID_ADC);
  adc_init(ADC, SystemCoreClock, ADC_FREQ_MAX, ADC_STARTUP_FAST);
  adc_configure_timing(ADC, 0, ADC_SETTLING_TIME_3, 1);
  adc_configure_trigger(ADC, ADC_TRIG_SW, 0); // Disable hardware trigger.
  adc_disable_interrupt(ADC, 0xFFFFFFFF); // Disable all ADC interrupts.
  adc_disable_all_channel(ADC);

I don't mean to ask somebody to explain them(if somebody like to you welcome to of course) but if someone could direct me to as where I can learn, I have search for hours without finding anything and it feels like I am missing something or don't get something.

All this aside, the multitask possibility of SAM3X really intrigued me and I have a urge to make my own non arduino bord since I am not happy with the Due in more than one way. Then the question comes, which µC should I go for?
An easy question I know... but I am looking for functionality, is there at all any µCs out there that can for real do two things at the same time or is DMA top of the line?
As I understand it DMA allows memory to be accessed directly without the CPU being involved and in that way the CPU can preform other tasks not pertaining to memory access? In short that is, I know there are some different modes.
In any case I want more than ATmega and maybe SAM3X is a good choice but I have no clue whats more out there and I have tried to orient my self but that just lead to headache, to much to new information all at one time.

SAM3Xs 12bit ADC and 12bit DAC is one of the more attractive peripherals and I want 12 bit converters in the µC but what do you guys have to say about which 32bit µC one should consider?

By the way, I have a friend who's into PC programming and we try to help each other out as we learn but there seams to be some rather big differences in software implementation restrictions regarding what you programming, a PC app or µC. But when I start talking about manually changing appropriate registers to set up whatever I was after he said something in the line of
"sure but that sounds like old age programming, there should be a much more efficient way of doing just that but in some automated kind of code. Or something, I don't know but doing that register for register, 32bits at a time sounds silly to me" and then he started talking about visual basic and how outputs and inputs are used but I think he does not understand the hole µC part. As he thought to through the PC program the LCD connected to the µC in some high level language but the PC should program the µC to then program the LCD.
Any way we are kind of lost.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top