aurdino due

Go To Last Post
54 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hello 

Actually I want to read voltage values  it on the Arduino tft screen .
 

Last Edited: Fri. Nov 10, 2017 - 10:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

zorb wrote:
The problem is ad8495 is a 16bit adc 

No, it isn't - it is a "Full K-Type Range 0° to 50° Thermocouple Amplifier w/Cold Junction Compensation"

 

AD849x-fbl

 

http://www.analog.com/en/products/amplifiers/specialty-amplifiers/thermocouple-interface-amplifiers/ad8495.html

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yea true ,so i am using ad7705 to overcome this problem, so now I need a program to get 2mhz from Arduino due as external clock for ad7705.

 

NOTE: I m already using the spi port for the tft display.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It looks as if the AD8495 just produces an Analog voltage.   And you read this voltage with a regular ADC.

The Due has a 12-bit ADC.    The AD7705 is 16-bit.

 

I doubt if you need 16-bit resolution.   After all,  the Thermocouple has a limited accuracy.   The AD8495 has a limited accuracy.

 

If you really want to use an extra external ADC chip like the AD7705,   it either has its own crystal or you supply a MCLK signal from the Due.

Reading the result from the AD7705 via the SPI interface can be done at any speed that you like.

 

The best way to design your project is write down your expected temperatures and accuracy required.

 

Unless you are monitoring a Nuclear bomb or a fast chemical reaction,  it is unlikely that the temperature changes very quickly.

 

You can connect multiple devices to the SPI bus.   Just like you have multiple passengers on a City Bus.

You can generate a MCLK signal in many ways from the Due.    But normally you just use a separate crystal for the AD7705.

 

David.

Last Edited: Wed. Nov 1, 2017 - 05:19 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

zorb wrote:
 i am using ad7705 to overcome this problem

To overcome what problem, exactly?

 

The problem you stated does not exist!

 

NOTE: I m already using the spi port for the tft display.

So what?

 

SPI is a bus - it is specifically designed to allow multiple devices to be connected!

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

awneil wrote:
SPI is a bus - it is specifically designed to allow multiple devices to be connected!
Using separate slave select (SS) signals.

(Just in case someone "thinks" they might be able to use the same select for multiple devices...)wink

David (aka frog_jr)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

to overcome this problem is ad8495 is a 16bit adc and Arduino due has 10bit adc

 

so to connect external clock signal 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

zorb wrote:
ad8495 is a 16bit adc

NO - it is not an ADC at all!!

 

As I showed you in #2.

 

And you agreed in #3.

 

It just gives you an analogue signal - which you can connect to the Due's ADC.

 

Job done.

 

There is no problem here!

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i need a program to generate 2mhz for due , if it doesnt work i can go with external crystal oscillator 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No program needed, just setup one of the timers to output the clock signal!

 

Jim

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

zorb wrote:
i need a program to generate 2mhz for due

No, you don't - you can just use the Due's own ADC!

 

There is no need for an external ADC.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

can you please tell me, how to do that 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

zorb wrote:

can you please tell me, how to do that 

What pin do you want the clock on? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

 

you connect it to your Arduino's Analogue IN - exactly the same as you'd connect to your external ADC's analogue input.

 

http://www.lmgtfy.com?q=Arduino+AD8495

 

https://ez.analog.com/thread/51921

 

https://www.adafruit.com/product/1778

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

is it possible for pin 15

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

zorb wrote:

is it possible for pin 15

does D15 have a timer associated with it?

 

Here is sample code for an UNO to output on pin D11

 

/* Generate 2MHz clock with 50% duty cycle */
const int freqOutputPin = 11; //D11
const int prescale  = 1;
const int ocr2aval  = 3;
const float period    = 2.0 * prescale * (ocr2aval+1) / (F_CPU/1.0e6);
const float freq      = 1.0e6 / period;

void setup()
{
    pinMode(freqOutputPin, OUTPUT);
    Serial.begin(9600);

    TCCR2A = ((1 << WGM21) | (1 << COM2A0));
    TCCR2B = (1 << CS20);
    TIMSK2 = 0;
    OCR2A = ocr2aval;

    Serial.print("Period    = ");
    Serial.print(period);
    Serial.println(" microseconds");
    Serial.print("Frequency = ");
    Serial.print(freq);
    Serial.println(" Hz");
}


void loop()
{
   
}

This code setups up timer 2 to divide cpu clock by 8 and output it on its associated output pin.

The DUE may have this on a different pin (I have not looked at the schematic), choose a timer that can output on the pin you want to use

and make the necessary changes.

 

Under stand how this works, then adapt to your needs.

NOTE: awneil has shown you an external ADC and clock are not needed.

 

Jim

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

okie thank you much

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

zorb wrote:
The problem is ad8495 is a 16bit adc and Arduino due has 10bit adc .

awneil wrote:
No, it isn't - it is a "Full K-Type Range 0° to 50° Thermocouple Amplifier w/Cold Junction Compensation"

zorb wrote:
yea true ,so i am using ad7705 to overcome this problem

david.prentice wrote:
It looks as if the AD8495 just produces an Analog voltage. And you read this voltage with a regular ADC. The Due has a 12-bit ADC. The AD7705 is 16-bit.

awneil wrote:
To overcome what problem, exactly? The problem you stated does not exist!

zorb wrote:
to overcome this problem is ad8495 is a 16bit adc and Arduino due has 10bit adc

awneil wrote:
NO - it is not an ADC at all!!

As I showed you in #2.

And you agreed in #3.

It just gives you an analogue signal - which you can connect to the Due's ADC.

Job done.

There is no problem here!

 

Does the OP actually reads anything that is posted?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

so can you tell a program to generate 2mhz in aurdino due ?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bart Simpsons Chalkboard

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, you can do many things.
But first of all, you should think about your design goals.
.
I suspect that you can use the Due's ADC. You might even be able to use a cheaper / simpler way to read the temperature.
.
The datasheet suggests 2MHz or 2.5MHz for MCLK. 2mhz is a very different value.
But you may be able to avoid the external ADC completely.
.
Please sit down and read all the replies. Ask if you do not understand something.
Engineering is about making use of available resources to achieve your design objective.
This produces a reliable solution that is often the cheapest too.
.
David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The ad8495 generates a voltage that is 5mV per ºC.

How are you going to measure this correctly?

It doesn't matter how good your ADC is if you don't have a good reference. Have you thought about that?

You can't just use VCC as reference in an application like this.

What temperature range you want to measure? Have you decided?

 

And so on...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

please anyone help me get these error clear 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Don't photograph the screen!!

 

See: http://www.avrfreaks.net/comment... - follow the instructions!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You are using an Arduino due, which has an ARM processor. It doesn't have those registers from timer 2, they are from a regular Arduino with an AVR processor.

 

Edit: here is the datasheet for the SAM3X8E MCU present in Arduino Due: http://ww1.microchip.com/downloa...

 

It's a massive 1500 page document. ARM MCUs are very complex, that's why many people prefer to use 8 bit MCUs for simple applications.

Last Edited: Thu. Nov 2, 2017 - 11:28 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
const int freqOutputPin =3; 
const int prescale  = 1;
const int ocr2bval  = 3;

const float period    = 2.0 * prescale * (ocr2bval+1) / (F_CPU/1.0e6);


const float freq      = 1.0e6 / period;

void setup()
{
    pinMode(freqOutputPin, OUTPUT);
    Serial.begin(9600);


    TCCR2A = ((1 << WGM21) | (1 << COM2B0));


    TCCR2B = (1 << CS20);  // No prescale

   
    TIMSK2 = 0;

    OCR2B = ocr2bval;

    Serial.print("Period    = ");
    Serial.print(period);
    Serial.println(" microseconds");
    Serial.print("Frequency = ");
    Serial.print(freq);
    Serial.println(" Hz");
}


void loop()
{
   
}

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You really are not listening - are you?

 

angry

 

I gave you instructions on how to get Windows to take a screenshot - you do not need to photograph your screen!!

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But anyway, since I'm sure you're not at all interested in studying the SAM3X8E datasheet, I found a link that will help you:

 

http://www.kerrywong.com/2014/09...

 

Let me just copy the Arduino Due code, so you can appreciate how different it is from "regular" Arduino code:

 

#include <Arduino.h>
 
uint32_t pwmPin = 8;
uint32_t maxDutyCount = 2;
uint32_t clkAFreq = 42000000ul;
uint32_t pwmFreq = 42000000ul; 
 
void setup() {
  pmc_enable_periph_clk(PWM_INTERFACE_ID);
  PWMC_ConfigureClocks(clkAFreq, 0, VARIANT_MCK);
 
  PIO_Configure(
    g_APinDescription[pwmPin].pPort,
    g_APinDescription[pwmPin].ulPinType,
    g_APinDescription[pwmPin].ulPin,
    g_APinDescription[pwmPin].ulPinConfiguration);
 
  uint32_t channel = g_APinDescription[pwmPin].ulPWMChannel;
  PWMC_ConfigureChannel(PWM_INTERFACE, channel , pwmFreq, 0, 0);
  PWMC_SetPeriod(PWM_INTERFACE, channel, maxDutyCount);
  PWMC_EnableChannel(PWM_INTERFACE, channel);
  PWMC_SetDutyCycle(PWM_INTERFACE, channel, 1);
 
  pmc_mck_set_prescaler(2);
}
 
void loop() 
{
}

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

El Tangas wrote:
ARM MCUs are very complex, that's why many people prefer to use 8 bit MCUs for simple applications

Surely, Arduino takes care of all that - even for the ARM-based ones?

 

But zorb does seem intent on over-complicating this!!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If he wants to complicate, I'll help him complicate. And now, I'll just ignore him until I see any evidence he has read my posts carefully.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
But zorb does seem intent on over-complicating this!!

Zorb seems intent on not listening, and not acknowledging any of the information presented in this thread.

 

Makes one wonder if we are being trolled.

 

El Tangas wrote:
I'll just ignore him until I see any evidence he has read my posts carefully.

Something everyone might want to consider

 

Jim

If you want a career with a known path - become an undertaker. Dead people don't sue! - Kartman

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thank you much for the help :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i am so thankfully to you people,

sorry if i being not so much responsive 

i am very new to this forum 

so please understand and need all of your help

thank you for understanding 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello everyone 

 

sorry for not explaining the things fully

so i would like to give a small explanation what my project is all about 

 

I am doing a project to measure pyroelectric coefficient by varying temperature ..

  • The set up includes k type thermocouple n I m interested to measure +10mv to + 900 mv
  •  component is the temperature controller ( oven ) which increases and decreases temperature and the output of dis s around +10 v to - 10 v

I m interested only in measuring the temp from 0 to 70 degree c ..

this two device output goes to a board

Which I have designed in the eagle software

  • The board has the components like ad8495 ,ad7705 , 2 opamps amplifier i,.e opa129u and opa277u 

I have also relays and capacitors , resistors and compensators

The output of dis board is connected to the Arduino due

So my,

  • 1st task is to read voltage from ad8495 and display it on the Arduino tft display

Now as Arduino due adc is 10 bit and ad8495 is a 16 bit I m using ad7705 wit dis to overcome dis problem

I can make the resolution change in the problem itself by using the function analogreadresolution (16)

But I cannot do it because I m already using an spi port for the tft display screen ..

So I m using an external adc

Now I need to write a program to create interface between Ad8495 and ad7705

And then read the voltage and display it on the Arduino tft display

And also ad7705 works wit 2mhz frequency I need to write a program to generate 2 mhz from Arduino due itself...

Next thing is I m using PID regulator which is connected to the temperature controller (oven) so now I need to write a code for pid in which p factors is to take proportional of analog value I is used to check how fast it s increasing / decreasing..

 

Next I need to write a code for the sinusoidal temperature modulation in which I ve to consider 3 main factors i.e mean temperature , frequency modulation and amplitude modulation

 

 

Next I need to write a code to send pyroelectrica signal to the second channel of adc ( adc has 2 differential channel in which one s used for temperature and the other is used is for pyroelectric signal)

 

thank you so much for you time

 

please help me out 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

zorb wrote:
sorry for not explaining the things fully

The big problem is that you just keep ignoring what people say, and repeating what you have already been told is wrong.

 

ad8495 is a 16 

And there you go again.

 

How many times do you need to be told: 

 

the ad8495 is not an ADC.

 

Why do you keeep ignoring that?

 

If you disagree, or don't understand, then say so!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yea sorry 

 

its not an ADC 

i agree with you sir

 

its a precision thermocouple amplifiers with cold junction compensation.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

zorb wrote:
please help me out

All of your issues have been answered by replies above!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the explanation. It would have been useful at the start of the thread. A schematic of your hardware would help. If the hardware is not finalised, say so.
.
You have not understood how an SPI bus works. Or why you are reluctant to set the ADC resolution to 12-bits.
The AD9845 will give 0mV to 350mV. Fine for the Due.
You want to measure the Pyroelectric voltage. Fine for the Due.
.
I doubt if your oven is nuclear. So everything is going to happen fairly slowly. Heating cycles over minutes rather than milliseconds.
It is very important to understand the difference between milliHertz and MegaHertz.
.
Again, it is necessary to put some approximate numbers into any description. Perhaps you are using an oven with microsecond response. Now that we know 0C..70C we are not looking at a 1000C furnace.
.
David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

zorb wrote:
its not an ADC 

i agree with you sir

So why do you keep saying that it is, then?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

but i didnt understand properly .

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i read it somewhere in google 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

zorb wrote:
but i didnt understand properly .

 

So, rather then just ignoring it - and not just once, but many times - why did you not ask for clarification?

 

Do you understand now?

 

Do you now understand that the AD9845 gives you an analogue output voltage? - it does not give you any number of "bits".

 

Do you now understand that this analogue voltage can be applied directly to the Arduino's ADC input? - you do not need a separate ADC.

 

EDIT

 

Added quote - for context.

Last Edited: Thu. Nov 2, 2017 - 03:08 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

zorb wrote:
i read it somewhere in google 

Where?

 

Again, rather than just ignoring what was said to you - many times - why did you not point to this, and ask for clarification?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You have some pretty impressive equipment there!

 

So why are you messing about with an Arduino for this?!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

Ok, enough beating the OP up about the A/D and the Analog front end.  It's not going to go anywhere.  The OP has posted a spec of sorts in Post #34.  Work off of that and limit the references prior to #34.

 

Jim

If you want a career with a known path - become an undertaker. Dead people don't sue! - Kartman

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So we need to see the schematic.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

this is the eagle file schematic

Last Edited: Thu. Nov 2, 2017 - 04:04 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thank you for your understanding

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But that schematic doesn't have any of the components you've been talking about!

 

Perhaps it would be better to just lock this thread, and start again with a proper description, full schematic, etc ...

 

EDIT

 

Oh - you've just completely changed it!

 

For reference, this is what you originally posted:

 

Now you're just drawing your chips as empty sockets!

 

I'm out.

Last Edited: Thu. Nov 2, 2017 - 04:12 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sorry for inconvenience 

Pages

Topic locked