Show Posts
Pages: [1]
1  Products / Arduino Due / Re: reliable startup? on: March 06, 2013, 01:04:26 pm
What about a 12v zener diode so it doesn't send voltage till it hits the 12 volt breakdown voltage?  That's the first thing I would try if I was getting brown-outs at startup.

which kind of connection do you suggest? I know the classic Zener scheme with resistor in series and Zener between Vcc and hearth. But this kind of connection only cuts Voltage when it goes above the zener limit (for what I understand).

Thanks in advance,
2  Products / Arduino Due / Re: reliable startup? on: March 03, 2013, 12:29:42 pm
Hi, I have the very same problem  smiley-cry I am developing a car diagnostic system that connects with the car ECU. Thus I take power from the OBD connector which is 13-14 Volts. Every time I start up, the DUE hangs then it is absolutely reliable as soon as I press RESET button. This is very annoying. The TLC7705IP could be a solution even though I do not have much space left on the shield. I use the 12V power source (car power reduced with a couple of diodes) to power the DUE and I have a stabilization circuit (switching to 5V + linear to 3.3V) to power the 5" TFT display. I made this to avoid high current to pass through the Arduino DUE board. Would it be better to use the 5V pin on the Arduino to power the TLC7705IP or the external switching circuit?
Thanks in advance,
3  Products / Arduino Due / Re: Due EEPROM alternative? SD? on: January 27, 2013, 12:18:13 pm
how complete is the library?
The library is almost complete, I tested it succesfully on one of my SST25VF016B chips. I was able to read single and continuous byte, write single byte and erase  the whole chip. Plus I can write and read the status registry  (writing is necessary at startup to remove area protection) and read the chip vendor info. Missing parts are: 32K and 64K block erase and continuous writing (word). I will use it embedded in a 5" TFT touchscreen (it has to be soldered) I have ordered some days ago. Once the tft has arrived I will finish the library.

I do not know Micron 5PQs but I will check the datasheets. I do not think it will be difficult to adapt the library if it is a serial Flash via SPI. Of course I have to find a couple of chips to experiment on.

please, remember to put a link to your library here,144446.0.html
when you are done!
I will!!!


4  Products / Arduino Due / Re: Due EEPROM alternative? SD? on: January 26, 2013, 02:00:49 pm
I am using SST25VF016B flash (2 MB) with DUE and I am quite happy with it. I am writing a small Lib to interface with it. You can find it here: It is not yet finished, but quite complete. It is pretty fast (I drive SPI bus at 42 MHz, DUE half speed) and you can address it as if it was an EEPROM.
5  Products / Arduino Due / Re: SoftwareSerial for Arduino Due on: January 19, 2013, 03:31:17 pm
Thanks for the appreciations. And yes, I would really like to see the schematics for LM393!!!
Do not worry to ask for the code, I have already stolen something from the your code (the one you posted) and tested this evening with success  smiley-lol

About the pinout I posted the full code some posts behind. Following you can find the link:

Download it and open the file named Td5Defs.h, it contains all the pinout for Atmega328p and for Mega2560.
Anyway here is a brief summary:
#if  defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
  #define LCD_D7                2
  #define LCD_D6                3
  #define LCD_D5                4
  #define LCD_D4                5
  #define lcdBKlightPin         6
  #define LCD_RS                7
  #define LCD_EN                8
  #define ledPin                9
  #define SD_CS                10
  #define MOSI                 11
  #define MISO                 12
  #define SCK                  13
  #define keyPadPowerPin       A0
  #define keyPadButtonsPin     A1
  #define K_OUT                A2 
  #define K_IN                 A3
  #define SDA                  A4
  #define SCL                  A5

#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  #define LCD_D7               40
  #define LCD_D6               38
  #define LCD_D5               36
  #define LCD_D4               34
  #define lcdBKlightPin         2
  #define btEnablePin           7
  #define LCD_RS               22
  #define LCD_EN               24
  #define ledPin               13
  #define SD_CS                53
  #define MOSI                 51
  #define MISO                 50
  #define SCK                  52
  #define keyPadPowerPin        3
  #define keyPadButtonsPin     A1
  #define K_OUT               A15
  #define K_IN                A14
  #define SDA                  20
  #define SCL                  21
Everything is OpenSource - OpenHardware so I am very pleased to share. There is only a little part I cannot share publicly: the seed-key table (residing in an external EEPROM) since it is reverse engineered and I fear to be break some law. Here you can find the rest of the project (non Arduino related):
There is some Android code too (still in very early stage and not published yet), since it connects to my 8" tablet via bluetooth and uses it as a second monitor (LCD is primary.

If you are interest you can contact me via e-mail, it is on my website.

So you are going to use your project on the motorbike? Really interesting, since I am a biker too!!!! BTW I really need a RTC. Which one do you use? Is it compatible with DUE levels or do you use a translator?

6  Products / Arduino Due / Re: SoftwareSerial for Arduino Due on: January 19, 2013, 05:25:01 am
Hardware Serial works  at 10400 baud smiley-grin

I cannot explain the two chips burned but I should have done something wrong on the breadboard... probably my fault (I ordered five more MC33290 to be sure!!!).

I had to make some minor changes to my code, but eventually communication was stable with DUE. No frames lost even under continuous writing/reading (I tested instrument mode, it exchanges a frame every 250 ms).

Thanks to everybody for your suggestions!!!

7  Products / Arduino Due / Re: SoftwareSerial for Arduino Due on: January 19, 2013, 01:13:33 am
At the very beginning the code was stripped to almost nothing, but on Atmega328p there was no way to receive long frames. Then I made some researches on the web and I found many people having the same problem at 10400 baud (how OBDuino works is a mistery to me...) so I switched to Software serial and everything worked OK. I never tried to do the same thing on Mega2560 (which is very similar to your 1280).
Now I have three devices running with SoftwareSerial: the ECU emulator, a basic device with Atmega328p and LCD 20x4 and a full diagnostic device (see video below) running on Atmega2560. Yesterday I tried a very basic circuit and SW with Arduino DUE and MC33290 but I do not know how I got two chip (MC33290) burned  smiley-cry This is very strange because I tested them both on the ECU emulator prior to connect them to DUE and they worked. Once connected to TX/RX on the DUE they got burned smiley-mad ....really strange (and SAD, since they are not very common and now I have only one left). Never happened before during the hundreds of test I did to have the project running....

I really have to learn many things about this DUE board!!! smiley-roll-blue

Anyway here is the device (with Mega2560) running on my Land Rover Defender:

This video was taken last Summer and many functions were missing, now it is quite complete and it is able to save a log fuelling data on the SD card while running, reset errors, read settings and so on.

Next step is to upgrade to Arduino DUE and 5" TFT touch display. It seems it will not be as easy as I though.....
8  Products / Arduino Due / Re: SoftwareSerial for Arduino Due on: January 18, 2013, 12:32:50 pm
thank for sharing your experience. Before using a special version of SoftwareSerial (modified by me) tuned for 10400 baud, I tried for a while the Hardware Serial with no success. My initial code was similar to yours. It worked, but the problem was on long frames. It was reliable up until the first three or four bytes then it went out of sync starting loosing bits. At the beginning I used Atmega328p and the only solution I found was adapting the SoftwareSerial library. After few months I run out of RAM so I upgraded the controller to Atmega2560 but I did not try to go back to Hardware Serial (at that point communication was already very reliable). Maybe, as in your case, it worked with the Mega board. Now I am going to try it first on Atmega2560 then, if it works, I will try it on DUE.

In my code (I borrowed it from OBDuino project) states 2 and 3 share the same code, 25 ms LOW and 25ms HIGH.

9  Products / Arduino Due / Re: SoftwareSerial for Arduino Due on: January 17, 2013, 01:18:39 pm
Thanks to you all for your answers.

I think I will try again Hardware Serial. First time I tried it was with Atmega328p and it failed. Then when I upgraded to Mega2560 I did not try again because the software was very stable then. But since I have to rewrite half of the program (LCD panel is going to be replaced by a 5" TFT display so the whole HMI must be rewritten) there is space for many tests smiley-razz

However here is the software (for Atmega2560):

OBD2 communication management is in file td5comm.cpp, this is the read/write part:
boolean Td5Comm::read_byte(byte * b)
  int readData;
  boolean success = true;
  byte t=0;

  //digitalWrite(ledPin, HIGH);
  while(t != READ_ATTEMPTS  && (
  //digitalWrite(ledPin, LOW);

  if (t >= READ_ATTEMPTS)
    success = false;

  if (success)
    *b = (byte) readData;

  return success;

void Td5Comm::write_byte(byte b)
  //digitalWrite(ledPin, HIGH);
  delay(Td5RequestByteDelay);  // ISO requires 5-20 ms delay between bytes.
  //digitalWrite(ledPin, LOW);

If somebody can give me some suggestions they are very welcomed  smiley

Thanks again,
10  Products / Arduino Due / Re: SoftwareSerial for Arduino Due on: January 16, 2013, 03:43:49 pm
The DUE has 4 hardware serial port, doesn't it? Why are you needing software serial ports?
Because I am developing an automotive project which needs 10400 baud on the serial port. With Atmega328P and Mega2560 I tried to set the hardware serial port to 10400 but I could not connect to the ECU of the car. So I modified the SerialSoftware library in order to accept this connection speed and it worked like a charm. I have been testing the system for more than 6 months and it almost never dropped a frame.
Now I fear to have the same problem on the new DUE so I would be very happy to have a SoftwareSerial library to modifiy to 10400 baud.
11  Products / Arduino Due / Re: SoftwareSerial for Arduino Due on: January 16, 2013, 01:05:20 pm
Doesn't this belong in the DUE section?
You are right, this is my first post and I posted it in the wrong place, sorry smiley-sad
Is it possible to move it to the DUE section?

I don't think there are any problems using the Due with SoftSerial
The Software serial library is not present in the DUE tree. I tried to copy it to the libray folder but it won't compile (it links avr libs). And the reason was obvius once I looked inside: SoftwareSerial is tuned only for 8,16,20 MHZ (DUE is 84 MHz) and makes some use of inline assembly . Moreover DUE has (I think) a different approach to change interrupts.
But I could be wrong, I have been using the 1.5.1 IDE only for two days.
12  Products / Arduino Due / SoftwareSerial for Arduino Due on: January 15, 2013, 12:38:27 pm
I am trying to port an automotive project I have been working on for a while (on Mega 2560 board) to my brand new Arduino Due board.
Problem is that SoftwareSerial library is missing. I need it to sync with OBD 10400 baud since standard Serial is not accurate enough at this speed.
I modified the original library to work at 10400 baud and it connected flawlessy. Unfortunately my version does not compile under Due board and no other version is available.
Is there any port under way, of the library?

Thanks in advance,
Pages: [1]