Show Posts
Pages: [1] 2
1  Products / Arduino Due / Re: Arduino due / ppm on: December 03, 2013, 05:19:08 pm
Greetings!

The easiest solution depends on what you are trying to do. If you are simply trying to control servos, then the due servo library will be the most elegant solution. It can be found here: http://arduino.cc/en/Reference/Servo

If you are trying to simply call a function or pulse a pin, etc at varying time intervals or frequencies, then the following library is a great tool. I merged all of my code with it a while back, and it is the most up to date. It has great documentation and examples on how to use it. It can be found on github here: https://github.com/ivanseidel/DueTimer

This allows you to set up as many as 9 different timers that can run different functions within your program. You configure the timer with either a frequency in Hz or a period in microseconds. Then you set which function the timer will call.

Am I understanding your question right?

Cheers!
SRG
2  Products / Arduino Due / Re: How to use second I2C? on: April 11, 2013, 03:36:47 pm
So in summary, is this correct?

If using Pin 20 and 21:
Internal pullups are provided.
Use Wire.setup() to control these.

If using SCL1 and SDA1:
You must provide 1.5k pullup resistors
The pullup source is taken from the 3.3V pin near the RESET pin.
Use Wire1.setup() to control these.

If this is all true, then I am unable to get pins 20 and 21 working. They just stay at logic high all the time. Have I missed something? I'm just running the master code here http://arduino.cc/en/Tutorial/MasterWriter

Will this work with just one device? I am just using one device and a logic analyzer to monitor the pins.

Thanks,
Doug

I went ahead and used the 1.5k pullup resistors on both pairs of inputs. This worked for me. Let us know if that fixes it for you.
3  Products / Arduino Due / Re: Timer Library for Arduino DUE on: April 04, 2013, 06:48:34 pm
Hi!
As i like libraries, i have done one for Timers on the Arduino DUE.

You can check it out here: https://github.com/ivanseidel/DueTimer

All 6 timers are fully implemented, and ready to play with...

I have merged all the features of my timer library with his. This is a great timer library, and we would love feedback for any features that people would like to see.
4  Products / Arduino Due / Re: Timer Library for Arduino DUE on: April 04, 2013, 04:50:35 pm
Because you have included this line:
Code:
TC_Configure(t.tc, t.channel, TC_CMR_WAVE | TC_CMR_WAVSEL_UP_RC | TC_CMR_TCCLKS_TIMER_CLOCK4);
in your object constructor instead of your "setFrequency" function, there is no way to modify which clock is used for a given timer after the user has declared it. Here, you are using
Code:
TC_CMR_TCCLKS_TIMER_CLOCK4
for every timer, which is the way cmaglie originally posted his example.

I am trying to figure out if this line can be moved down to your "setFrequency" function. If so, then adding in support for the dynamic clock selection will be really easy. :]

Cheers!
SRG
5  Products / Arduino Due / Re: Timer Library for Arduino DUE on: April 04, 2013, 04:43:00 pm
Obs.: This is very weird, because i didn't saw your project on github before doing my library, and the name is the SAME! =]

Yea, I noticed that too. I don't know what happened there. I think our libraries do essentially the same thing. I think I like yours better because it follows the object oriented format that the timer libraries on the older Arduinos use. The only thing I would like to add to your library is the chunk that picks the best clock to use based on what frequency the user inputs. This was suggested to me by another user, and it results in a smaller clock error. That is the "pickClock" function in my code. Any thoughts on that?

Again, nice work on the library. I would be more than happy to join you on your library, if that is the format that everyone likes better. I did mine as purely functions, you did yours with timer objects, which I think is closer to the Arduino standard.

Does everyone generally agree on this??

Cheers!
SRG
6  Products / Arduino Due / Re: RTClib DS1307 with Arduino on: April 01, 2013, 05:03:38 pm
The example is using a very high serial baud rate (115200). You probably don't have your serial monitor set to that high of a baud rate. (its a dropdown menu in the bottom right hand corner.

Hope that helps!
SRG
7  Products / Arduino Due / Re: Timer Library for Arduino DUE on: April 01, 2013, 04:52:36 pm
I also have a timer library I have been working on. It can be found here: https://github.com/SomeRandomGuy/DueTimer

ivanseidel's library is a very nice implementation!

I have a function that picks the clock that will produce the smallest error for the frequency entered by the user. I am curious how helpful that will be.

Would also appreciate some thoughts and feedback.

Cheers!

SomeRandomGuy
8  Products / Arduino Due / Re: Timer Interrupts on Due on: March 01, 2013, 11:51:23 pm
Here is a link to the new library version: https://github.com/SomeRandomGuy/DueTimer

When you download this, remove the "-master" part of the folder name so that it will show up correctly in the Arduino IDE and drag it into your libraries folder.

This has several new improvements. I would love some more testing/feedback if any of you get a chance.

Hope this is helpful!

SRG
9  Products / Arduino Due / Re: Timer Interrupts on Due on: February 28, 2013, 10:27:02 pm
Thanks for the idea BKM! I have added it to the library along with several other major improvements that should completely remove any IRQ references from the sketches and make it much cleaner and more user friendly. I will attach a link to my github repo tomorrow night once I get to test it a little bit.
10  Products / Arduino Due / Re: Timer Interrupts on Due on: February 24, 2013, 03:40:45 pm
Thanks for the feedback! Good to know that it is working well. If anyone thinks of some useful additions or improvements, I would be happy to add those in.

Thanks for taking a look at it.
11  Products / Arduino Due / Re: Timer Interrupts on Due on: February 19, 2013, 12:45:52 am
My classmate and I have written a timer library that encapsulates cmaglie's "Black Magic" code and allows the user to pass their own function that they want to be executed by the timer as a function pointer. I have included an example program that shows how this is used. It also cleanly allows the user to start multiple timers for multiple functions in the same sketch. I would appreciate any suggestions, criticism, comments, etc.

Thanks!
12  Products / Arduino Due / Re: DS1307 RTC + Due + i2c on: February 18, 2013, 03:22:32 pm
I have gone through this too. Yes, the two resistors on the DS1307 breakout board pull the I2C lines up to 5V. This is NOT what you want. Remove/Don't Install those resistors and connect your own from the 3.3V supply on the board to the I2C lines. You can do this on a proto shield or something, on the arduino side of the I2C lines. The DS1307 will need 5V connected to its VCC pin, but it will not bleed over onto the I2C lines with those resistors on the breakout board removed  smiley

In summary, do not attach these resistors


Instead, attach resistors from the 3.3V supply of the Due to the Due's I2C pins.

On the breakout board:
VCC = 5V
GND = gnd
SDA = Due SDA pin
SCL = Due SCL pin.

The resistor values on the Due side will require some playing with. As mentioned above, the Due will not drive/sink much current at all. Let me know if you find a combination that works best. It will also depend on the length of your wires.

Best of Luck!
13  Products / Arduino Due / Re: RTClib DS1307 with Arduino on: February 02, 2013, 02:14:24 pm
Ahh, I knew I was missing something. You will also need to edit the example sketch. The RTC object that is used in the example needs to be de-capitalized everywhere it is used. This is a reserved feature/bug in the complier where it does not like variables in all caps. Change that throughout the sketch to "rtc" and it should complile right up!

Code:
// Date and time functions using a DS1307 RTC connected via I2C and Wire lib

#include <Wire.h>
#include "RTClib.h"

RTC_DS1307 rtc;

void setup () {
    Serial.begin(57600);
    Wire.begin();
    rtc.begin();

  if (! rtc.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(__DATE__, __TIME__));
  }
}

void loop () {
    DateTime now = rtc.now();
   
    Serial.print(now.year(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.day(), DEC);
    Serial.print(' ');
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();
   
    Serial.print(" since midnight 1/1/1970 = ");
    Serial.print(now.unixtime());
    Serial.print("s = ");
    Serial.print(now.unixtime() / 86400L);
    Serial.println("d");
   
    // calculate a date which is 7 days and 30 seconds into the future
    DateTime future (now.unixtime() + 7 * 86400L + 30);
   
    Serial.print(" now + 7d + 30s: ");
    Serial.print(future.year(), DEC);
    Serial.print('/');
    Serial.print(future.month(), DEC);
    Serial.print('/');
    Serial.print(future.day(), DEC);
    Serial.print(' ');
    Serial.print(future.hour(), DEC);
    Serial.print(':');
    Serial.print(future.minute(), DEC);
    Serial.print(':');
    Serial.print(future.second(), DEC);
    Serial.println();
   
    Serial.println();
    delay(3000);
}

Let me know if that works for ya!
14  Community / Local Groups / Re: Arduino Users in Tennessee??? on: February 02, 2013, 01:58:45 pm
Sweet! I go to Tennessee Tech, and yes, machining info would be sweet.

What brought you up this way?
15  Community / Local Groups / Arduino Users in Tennessee??? on: January 19, 2013, 11:58:29 pm
Any other Arduino fans out there in Tennessee?

Shout out if you are out there!
Pages: [1] 2