Show Posts
Pages: [1]
1  Using Arduino / Installation & Troubleshooting / Re: Arduino ignoring "0" bytes sent over serial on: January 13, 2014, 09:37:58 am
Code:
  Serial.begin(115200,'SERIAL_8N0');
'This' 'is' 'wrong'. There are no single quotes required.

Thanks, I will fix that but I don't think it is the problem.  I just added it as I was troubleshooting this morning.
2  Using Arduino / Installation & Troubleshooting / Re: Arduino ignoring "0" bytes sent over serial on: January 13, 2014, 08:33:55 am
The problem is that Serial.available() does not increment when the byte sent is 0.  So for example if I did the following on the pc:
Serial.write(0)
Serial.write(0)
Serial.write(0)
Serial.write(0)

And then ran Serial.available() on the arduino it would return 0.

I can see the rx light on the FTDI usb to serial adapter blink so I know that data is being put on the line.  I have tried this on both an arduino pro mini and an arduino uno.
3  Using Arduino / Installation & Troubleshooting / Arduino ignoring "0" bytes sent over serial on: January 13, 2014, 07:17:42 am
I am trying to send binary data from my PC to my Arduino but I am having an odd problem.  When I try to send 0b00000000 from the pc the arduino seems to ignore the byte.  It doesn't even increment Serial.available().  On windows I have tried using matlab with fwrite(s,0,'uint8'), processing with port.write(0x00) and on linux I have tried perl with $port->write(pack("C",0)).  all give me the same result.

My ultimate goal is to send single precision numbers in binary format and this problem showed  up when I tried to send the 4 bytes of (single)1 and Serial.availble() only incremented by 1.

Thanks

Code:
#include <LiquidCrystal.h>

#define LCD_WIDTH 16
#define LCD_HEIGHT 2

LiquidCrystal lcd(7, 6, 5, 4, A2, 2);

void setup() {
  Serial.begin(115200,'SERIAL_8N0');
 
  lcd.begin(LCD_WIDTH, LCD_HEIGHT);
}

void loop() {
  int i;
  int count;
  byte a;
  union {
    byte asBytes[4];
    double asDouble;
  } byte2double;

 
  count = Serial.available();
  lcd.setCursor(0,0);
  lcd.print(count, DEC);
}
4  Using Arduino / Installation & Troubleshooting / Re: Bootloader problems on: October 27, 2011, 12:04:24 pm
Well, I may have sorted it out.  First of all I set upload.verbose=true in my preferences.txt file so that I don't need three hands to program my arduino.  Then I hold the reset button until I get the "avrdude: ser_open(): setting dtr" message it seems to load fine.  I thought that the mini pros were supposed to have automatic resets but right now I am just happy that it works.
5  Using Arduino / Installation & Troubleshooting / Bootloader problems on: October 27, 2011, 10:39:33 am
The problem that I am currently having is that I burn the bootloader using my sparkfun parallel programmer and then I am able to use my MiniUSB adapter to load a sketch once.  After I have loaded a sketch I can't load another until I burn the bootloader again.  The odd thing is that if I load the blink.pde sketch it appears to run fine, but the arduino software is not able to establish sync to the board when programming.  Does anyone have any thoughts?

What I have:
2xArduino Mini Pro w/328p 5v/16MHz with regulator and crystal replaced to make it 3.3V/8MHz
2xArduino Mini w/328p 5v/16MHz with regulator and crystal replaced to make it 3.3V/8MHz
Sparkfun Parallel Programmer
MiniUSB adapter
6  Using Arduino / Installation & Troubleshooting / Re: Problems Programming Mini w/ATmega328 on: September 06, 2011, 11:07:34 am
So I did some more reading and I found that some older versions of the bootloader only flash the LED once so it sounds like I at least have something there because if I did not then I would not be getting any LED flashes.  Is there any way to find out what version of the bootloader I have installed?  Also, I have been trying to find the source code for the arduino bootloader but all I can find are links to AVRDUDE source.  If someone could point me to the source code for the bootloader I would appreciate it.
7  Using Arduino / Installation & Troubleshooting / Re: Problems Programming Mini w/ATmega328 on: September 03, 2011, 05:01:45 pm
I don't think that the mini has an automatic reset from what I have read so I have a push button on the reset pin.  When I press that button the LED on pin 13 flashes once, not three times like I would expect.  I have tried pressing the button 1 second before I hit upload and I have also tried holding the button until the programmer is ready to send the data.
8  Using Arduino / Installation & Troubleshooting / Re: Problems Programming Mini w/ATmega328 on: September 03, 2011, 12:07:03 pm
I just tried it but it didn't seem to help.  I have a the FTDI USB driver that emulates a serial port so shouldn't it work just like it was being programmed on a serial interface?  Thanks for the fast reply.
9  Using Arduino / Installation & Troubleshooting / Problems Programming Mini w/ATmega328 on: September 03, 2011, 11:35:43 am
I just bought an Arduino mini w/ATmega328 and a miniUSB programmer and am having problems loading the blink program on to the Arduino.  If I do a verbose upload it appears to hang at "avrdude: ser_open(): setting dtr".  I am running version 0022 of the Arduino programmer and I have added the following entry for my board.

Code:
mini328.name=Arduino Mini with ATmega328

mini328.upload.protocol=stk500
mini328.upload.maximum_size=28672
mini328.upload.speed=115200

mini328.bootloader.low_fuses=0xff
mini328.bootloader.high_fuses=0xd8
mini328.bootloader.extended_fuses=0x05
mini328.bootloader.path=bt
mini328.bootloader.file=ATmegaBOOT_168_atmega328.hex
mini328.bootloader.unlock_bits=0x3F
mini328.bootloader.lock_bits=0x0F

mini328.build.mcu=atmega328p
mini328.build.f_cpu=16000000L
mini328.build.core=arduino

I have tried on a windows 7 64-bit PC and a windows xp machine.  One odd bit of behavior that I notice is that when I reset the LED i have on pin 13 only flashes once.  I read that this should flash three times if the bootloader is working so I am thinking I may have somehow got one without a bootloader.  Also, when I try to upload to the Arduino the RX LED on the USB module flashes but the TX LED does not.  Can anyone confirm my suspicions that the bootloader is gone or have any thoughts on other things that might be wrong?
Pages: [1]