Show Posts
Pages: [1] 2 3
1  Using Arduino / Installation & Troubleshooting / Re: uploading using a serial port on: May 02, 2013, 04:33:22 am
HI
Thanks for your reply. I have tried two different cables, both of which work fine for Mr Z. I have tried two different Arduino IDE versions (1.5.2 and 1.4).
I do not think it is the Arduino as its works with the ch340 and I get data corruption if I do a loop back test. It gets worse as I increase the baud rate. 300 baud is just about OK but I need 115200 to upload.
Mrs Z
2  Using Arduino / Installation & Troubleshooting / uploading using a serial port on: May 02, 2013, 04:01:34 am
Hello
I am having a problem with my serial communication when uploading sketches. I have a ch340 usb to serial converter connected to my atmega328p-pu. The DB9 is connected as

pins 2 and 3 as RX/TX via MAX232
pin 4 as reset via MAX 232 and a 100nF capacitor
pin 5  GND
pins 7 and 8 connected together.

It works fine and I am able to upload to the chip but if I swap the ch340 device for my serial cable from my real serial port it does not work. It gets as far as dropping the reset line so the LED on pin 13 flashes but no upload and I get the avr sync 0x00 error.
I am rather baffled. Any ideas?
Mrs Z
3  Using Arduino / Programming Questions / Re: Serial monitor converting to 32 bits? on: April 23, 2013, 12:24:19 pm
Thank you , this is exactly what I want. I did not realise that types not listed in the reference were available.
Thanks again
Mrs Z
4  Using Arduino / Programming Questions / Re: Serial monitor converting to 32 bits? on: April 23, 2013, 08:52:32 am
Thank you again.

I guess this means that I cannot stop it?  I wanted to print a 16 bit integer.

Mrs Z
5  Using Arduino / Programming Questions / Re: Serial monitor converting to 32 bits? on: April 23, 2013, 08:27:52 am
Hi
Thanks for your replies. What is confusing me is that the 16-bit integer I send it is being converted to 32 bits. Why?
I put the attempt to 32 bit print in to show that I cannot use 32bit  integers or pass them so why does serial monitor do it?

Mrs Z
6  Using Arduino / Programming Questions / Serial monitor converting to 32 bits? on: April 23, 2013, 08:04:55 am
I am at a loss to understand how this code produces the output in the serial monitor.

Code:
void setup() {
  // put your setup code here, to run once:
   Serial.begin(9600);
   print_i(0xFFFF);
   print_i(0x7FFF);
   print_i(-1);
   print_i(0x8000);
   print_i(0x80000000);
   print_i(0xFFFF8000);
}
void print_i(int i) {
   Serial.print(i,HEX);
   Serial.print("\t");
   Serial.println(i,BIN);
}
void loop() {
  // put your main code here, to run repeatedly:

}


output in serial monitor:

Code:
FFFFFFFF 11111111111111111111111111111111
7FFF 111111111111111
FFFFFFFF 11111111111111111111111111111111
FFFF8000 11111111111111111000000000000000
0 0
FFFF8000 11111111111111111000000000000000

7  Community / Bar Sport / Re: Arduino based replicator on: April 22, 2013, 01:40:03 am
May I remind you all of the Prime Directive. arduinoPi could be from a non-Federation species.
For 1 brick gold pressed latinum  or 2 weeks hollodeck-time I'll sell you the info.
I have reported you for trying to sell Federation technology.
8  Using Arduino / Programming Questions / Re: Arduino-to-Arduino serial sending array on: April 20, 2013, 02:46:54 pm
Quote
Well i think i will take the risk and just assume there is no packet loss. There is no serious problem if a packet is lost and the connection is not over a long distance.

It is not just an issue of packet loss. If you wait for 19 bytes and 1 is lost you will be out of sync forever, e.g. say you lose byte 4, you will read 5 as 4 and 6 as 5 etc.  and so on. This did happen to me once (but only ever once) and all of my packets were out of sync. The only way to fix it was to reset. I now (nearly) always use at least a packet terminator.
9  Using Arduino / Microcontrollers / trying to upload using max232 with 19200 BAUD [solved] on: April 14, 2013, 04:07:31 am
Hello
I am trying to create a new upload option to use my MAX232CPE chip with an atmega328 on a breadboard.
If I connect RX<->TX and run the Serial Monitor I find that the maximum speed it will work at is a lot less than the bootloader upload speed.
I created a new entry in boards.txt to use 19200 and am trying to create a corresponding bootloader to match the speed. I am getting the error in the attachment below.
This is what I have added to boards.txt
Code:
unoMAX.name=Arduino Uno Via MAX232
unoMAX.upload.protocol=arduino
unoMAX.upload.maximum_size=32256
unoMAX.upload.speed=19200 <----------------------------------- changed here
unoMAX.bootloader.low_fuses=0xff
unoMAX.bootloader.high_fuses=0xde
unoMAX.bootloader.extended_fuses=0x05
unoMAX.bootloader.path=optiboot
unoMAX.bootloader.file=optiboot_atmega328MAX.hex  <----- changed here
unoMAX.bootloader.unlock_bits=0x3F
unoMAX.bootloader.lock_bits=0x0F
unoMAX.build.mcu=atmega328p
unoMAX.build.f_cpu=16000000L
unoMAX.build.core=arduino
unoMAX.build.variant=standard

This is what I have added to the Makefile
Code:
atmega328MAX: TARGET = atmega328
atmega328MAX: MCU_TARGET = atmega328p
atmega328MAX: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=19200'   <----- changed here
atmega328MAX: AVR_FREQ = 16000000L
atmega328MAX: LDSECTIONS  = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
atmega328MAX: $(PROGRAM)_atmega328MAX.hex   <----- changed here
atmega328MAX: $(PROGRAM)_atmega328MAX.lst     <----- changed here

I want to create a new entry rather than change the existing one so I can still use my 'real' arduino as normal.
I am guessing that I have missed something somewhere ...

All help gratefully accepted.
Thanks
Mrs Z

[EDIT] I am using 1.0.4
10  Using Arduino / Networking, Protocols, and Devices / Re: changing I2C bus speed on: April 12, 2013, 06:32:09 am
Thank you everyone for the help.
After much experimentation using ports and all sorts, I now think I see the problem. My processing sketch refreshes the screen at 60Hz. The I2C bus runs at 100kHz. Even at one third of the speed (thanks for this Erdin - I was using the wrong variable) there is no chance of monitoring the bus in real time and being able to see what is going on. The best I could hope for would be to capture some data for half a second and plot it later.

Crossroads, how do I turn this into an excuse to buy a Due?

Thanks again
Mrs Z
11  Using Arduino / Networking, Protocols, and Devices / Re: changing I2C bus speed on: April 11, 2013, 03:57:28 pm
Thanks for this, robtillaart.
I think it would be much quicker to do it this way and use the two relevant bits in the port C register as I do not really care about having an analogue reading. I had not thought of that. This only leaves taking care of the time axis ...
Maybe I could use a timestamp in some way on the Arduino or Processing as I won't have a regular supply of samples?
Thanks again
Mrs Z.
12  Using Arduino / Networking, Protocols, and Devices / Re: changing I2C bus speed on: April 11, 2013, 02:35:41 pm
Thank you both for your help and suggestions.

This little tool is great for looking at this kind of thing:
http://www.saleae.com/logic
smiley-grin Crossroads, I can see that you are the person to ask when I need an excuse to buy myself a new toy ...  smiley-grin

I'm also new to processing and only just over a year old on arduino.
I just found this that may be helpful.

This looks good. I can't work out how to port it to Arduino though. It is a bunch of C files and headers.
Over a year on Arduino! You are an oldie compared to me, Riva.

Thanks again both of you.
Mrs Z.
13  Using Arduino / Networking, Protocols, and Devices / Re: changing I2C bus speed on: April 11, 2013, 11:50:53 am
Thanks Riva

Your sketch looks very useful. It seems to approach the problem in a dfferent way, reporting changes rather than using samples so there are less messages. I may update what I have to do a similar thing (once I have worked out how). I have never used interrupts so it will be a good learning experience.
I had seem the SUMP thread but it is way beyond my current level of knowledge as I am just a beginner.

Thanks again
Mrs Z.
14  Using Arduino / Networking, Protocols, and Devices / Re: changing I2C bus speed on: April 11, 2013, 11:18:50 am
Thanks for this Erdin.

Am I changing the correct variable to bring the speed down?
15  Using Arduino / Networking, Protocols, and Devices / Re: changing I2C bus speed on: April 11, 2013, 09:10:27 am
Hi Crossraods
Thanks for the reply. I am running the master writer slave reader sketches on two Arduinos from

http://arduino.cc/en/Tutorial/MasterWriter

I have my Arduino no1 with the above sketch connected to the I2C bus along with them. The slave reader is receiving the information as it is printing it on a serial monitor on another serial port so the bus is definitely active.

As regards your comment about 100kHz or 400Khz does that mean I cannot slow it down by setting TWI_FREQ to 100L?
Pages: [1] 2 3