|
Page 1 of 1
|
[ 17 posts ] |
|
Arduino communication problem
| Author |
Message |
|
Boro
Joined: Fri Jun 01, 2012 8:00 am Posts: 63 Location: Gospić Croatia
|
 Arduino communication problem
Hi, Working through the manual i had hardly any problems with the AVR Studio example. But when i go to arduino i have communcation errors. My USB serial port is coming up as COM3 and switch is definitely set to AVR . The hello world example compiles but when i go to upload i get the following error .. avrdude: stk500_getsync(): not in sync: resp=0x00 avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51 Also in putty i get just a green block and cant type anything, is that normal? 
|
| Thu Jul 12, 2012 10:50 am |
|
 |
|
Boro
Joined: Fri Jun 01, 2012 8:00 am Posts: 63 Location: Gospić Croatia
|
 Re: Arduino communication problem
Putty eventually gives out a fatal error - Error reading from Serial device
Ive also now tried installing the FTDI drivers from the DVD and still the same
|
| Thu Jul 12, 2012 11:08 am |
|
 |
|
Lazarus404
Joined: Thu Jun 05, 2008 2:26 pm Posts: 60 Location: NZ
|
 Re: Arduino communication problem
Have you looked up the correct baud rate etc. for your particular clone? It looks like, from the error, that your issue is related to an out of sync handshake.
_________________ try my game engine @ http://www.haxenme.org
|
| Thu Jul 12, 2012 4:33 pm |
|
 |
|
necron
Site Admin
Joined: Thu Jan 01, 1970 12:00 am Posts: 255
|
 Re: Arduino communication problem
Sounds like you blew away the bootloader. If you used AVR Studio to load programs then they overwrite the bootloader, so first with AVR studio re-write the bootloader THEN with the Arduino tool it should be able to establish comms with the board.
Andre'
|
| Sat Jul 14, 2012 3:57 am |
|
 |
|
Boro
Joined: Fri Jun 01, 2012 8:00 am Posts: 63 Location: Gospić Croatia
|
 Re: Arduino communication problem
Thanks I suspected that. Once i tried the propeller tool chain example and it worked I realised it wasnt an issue with serial USB. You really need a warning on page 104 that if you wish to follow on with the arduino tool chain that you need to restore the bootloader, or maybe i missed such a warning 
|
| Sat Jul 14, 2012 6:05 pm |
|
 |
|
necron
Site Admin
Joined: Thu Jan 01, 1970 12:00 am Posts: 255
|
 Re: Arduino communication problem
The manual explains this a number of times you must have skimmed over it. Basically, I show how everything works, then explain there is a pre-loaded bootloader, if you want something else, use AVR studio, but then you have to reload the bootloader of course, since you have erased it by programming anything else in there.
Anyway, it is working again?
Andre'
|
| Sat Jul 14, 2012 9:34 pm |
|
 |
|
Boro
Joined: Fri Jun 01, 2012 8:00 am Posts: 63 Location: Gospić Croatia
|
 Re: Arduino communication problem
Sorry didnt have time until now to try it..
From page 109.. "If you do happen to erase the Arduino bootloader accidentally or purposely and want to restore it, you will go into \BOOTLOADERS and pull the 328p bootloader .HEX file out and use that to program the AVR chip to restore it."
You said the P in 328P stands for Pico power version. When I go into the BOOTLOADERS directory there are two 328 hex files...
ATmegaBOOT_168_atmega328.hex ATmegaBOOT_168_atmega328_pro_8MHz.hex
Is it the first one, ignore the missing "P"? Im assuming that as we are running at 16MHz and not 8MHz?
|
| Sat Aug 11, 2012 6:41 am |
|
 |
|
necron
Site Admin
Joined: Thu Jan 01, 1970 12:00 am Posts: 255
|
 Re: Arduino communication problem
Use the first one.
Andre'
|
| Sat Aug 11, 2012 7:50 am |
|
 |
|
Boro
Joined: Fri Jun 01, 2012 8:00 am Posts: 63 Location: Gospić Croatia
|
 Re: Arduino communication problem
OK, in AVR studio opened the cham_AVR_work_01 project and then went Tools > Program AVR > Connect Then program tab > flash ..selected the above Hex file and then clicked program..it programmed. But it didnt work.. it wouldnt communicate in Putty I tried loading the cham_avr_work_01.hex file and that program did work. Is this not working because I rewrote the bootloader from the cham_avr_work_01 project with its settings?
|
| Sat Aug 11, 2012 11:36 pm |
|
 |
|
necron
Site Admin
Joined: Thu Jan 01, 1970 12:00 am Posts: 255
|
 Re: Arduino communication problem
Well, at this point not sure how much you have fragged it. But, the good news is as long as you have the AVR chip and the programmer, you can ALWAYs get it back. Its the stock bootloader, so you definitely have something wrong on the programming settings, that's all. If I recall, the latest version of the ARduino tool itself CAN communicate to the AVR programmer, so try this, just connect the programmer to the XGS, then use the Arduino tool ITSELF to flash the bootloader. Be warned, this is buggy, and might not work either. Anyway, email me directly at ceo@nurve.net, put your real name, and tell what the email is about, I get 200-300 a day, and I hate when I get an email: "its me can you help" No, intro, no signature etc.  Andre'
|
| Sun Aug 12, 2012 6:01 am |
|
 |
|
Boro
Joined: Fri Jun 01, 2012 8:00 am Posts: 63 Location: Gospić Croatia
|
 Re: Arduino communication problem
"Fragged" what does that mean?
Yeah I tried using the Arduino and got
avrdude: usbdev_open(): did not find any USB device "usb"
I also tried manually using avrdude in terminal mode
avrdude -c avrispmkII -t -p m328p and got avrdude: stk500_2_ReceiveMessage(): timeout
What i did notice at the start of all this was you had it on COM30. I ignore the fact mine came up with COM3 as I though I had nothing on it.
So I even tried going into device manager and changed the USB serial port to COM30. Thats when I started getting a Hotsync error. It took me awhile to realise that was a Palm Pilot error. I had an old palm pilot installed on this PC years ago. I disabled Hotsync but it still didnt change anything.
I know the USB serial port works because it works in Propellor mode. Im going to try it on another computer from scratch when I have time and if it doesnt work I'll email you.
|
| Sun Aug 12, 2012 10:37 pm |
|
 |
|
necron
Site Admin
Joined: Thu Jan 01, 1970 12:00 am Posts: 255
|
 Re: Arduino communication problem
"fragged" is a term from DOOM from the last 20 years, means "killed", "messed up".
Anyway, whenever you install any FTDI driver device it installs on a COM port, from 1 to 255, you have to figure out where it installs, in the manual, I cover this and show you in the CONTROL PANEL, to pay attention where it does this, so you can write it down. Then is the "virtual" com port, that the driver connects to for serial connectivity. What the value is on mine has nothing to do what it is on yours, it will be all over the place. But, for the AVR programmer, it has nothing to do with com ports, it talks directly via USB protocal to the ISP programmer to program whatever target its connected to.
Thus, you can just use the ISP programmer and forget about Arduino stuff. OR you have to put back the stock arduino bootloader WITH a AVR ISP programmer, this is the same no matter what, on the Chameleon or Arduino.
So, if you CAN program the Chameleon with the ISP programmer, then you know that's good, so then its just a matter of copying the bootloader back on there.
ALSO, you MUST make sure you have the serial switch in the correct position -- are you remembering this? In one position it connects the propeller chip to the USB UART, in the other position, it connects the AVR chip -- are you doing this properly?
Andre'
|
| Mon Aug 13, 2012 3:41 am |
|
 |
|
Boro
Joined: Fri Jun 01, 2012 8:00 am Posts: 63 Location: Gospić Croatia
|
 Re: Arduino communication problem
I was aware of the com port number but was trying anything especially when I realised I had hotsync from a palm pilot listening on com3. Was aware the programmer had nothing to do with com ports I saw that when I found it under Jungo in device manager. I was doing everything properly as far as I can see. I went today and installed everything on a laptop that didnt have much on it. Tried flashing the AVR ISP programmer as well. Same problem always. Looked even on other forums and its a common problem http://www.arduino.cc/cgi-bin/yabb2/YaB ... 528012/allMany said resetting the arduino device when it hits the comment like - Binary sketch size: 1074 bytes (of a 30720 byte maximum) that didnt work either. I knew it wasnt an issue with the isp programmer or setting because the hello world demo would load. I knew it wasnt serial USB issue either because the chameleon stuff would work on it. I then decided to download the arduino tools version 1.0.1. That didnt work and it wouldnt recognize my ISP programmer either. Same problems. Then I went and loaded the bootloader hex file again via AVR studio. Again it wouldnt work. I tried it again and forgot to disconnect the AVR ISP programmer when I was loading hello world example in the Arduino IDE and it worked. I then tried disconnecting the programmer and loading hello world via Arduino and it didnt work. Reconnected and it worked, then eventually it worked without it. Now it even works in Arduino 0017. Beats me why this solved the problem could be a coincidence, to me it seems illogical but I have read in forums that connected devices during loads can cause problems like this. Maybe if it stops working again I can try this and see if it wasnt a coincidence. Now putty is my issue. What am I supposed to get on the terminal screen in Putty? When I enter keys the tx/rx leds on the chameleon flash for each key but on the screen I get nothing is echo supposed to be turned on somewhere or something?
|
| Mon Aug 13, 2012 11:40 pm |
|
 |
|
necron
Site Admin
Joined: Thu Jan 01, 1970 12:00 am Posts: 255
|
 Re: Arduino communication problem
Well, that's good news. First, I didn't develop the arduino stuff, if I did - it would work  This is why I am not so into open source, its just not reliable, and no "one" can help, since you can't find the actual person that wrote the damn thing. Anyway, let's chalk it up to gremlins. Now, on putty. Putty is just a serial terminal program. Its not supposed to show you anything or do anything unless the program you load communicates thru it. Furthermore, if you load a program that talks thru the USB serial port, remember, FIRST the arduino tool will use this to program the board, then the board will need the SAME communication channel, so you need to close the arduino tool, then relaunch putty, and reset the chameleon (or arduino), so you can get a connection. There is only the ONE port going into the AVR so, you have to share them with programs, some programs can play nice and release the com port, others not so nice. Arduno tool is one of them if I recall. So, I just run the tool, load the program, then close it. Then run putty IF I am playing with a serial com program kind of thing. Andre'
|
| Thu Aug 16, 2012 6:52 am |
|
 |
|
Boro
Joined: Fri Jun 01, 2012 8:00 am Posts: 63 Location: Gospić Croatia
|
 Re: Arduino communication problem
Thanks for that. Everything is working fine now. That "you need to close the arduino tool, then relaunch putty, and reset the chameleon (or arduino), so you can get a connection" tip should be added to the manual I think, because my issues were probably related to something like that.
|
| Mon Aug 20, 2012 12:20 pm |
|
 |
|
necron
Site Admin
Joined: Thu Jan 01, 1970 12:00 am Posts: 255
|
 Re: Arduino communication problem
It is in the manual, search the text for all references to putty, serial, etc. I put it in there 2x I think. Did you read the manual cover to cover? I always suggest that THEN work thru it. In other words, skim read the whole manual, then work thru it. This is how I read books, I read them 3 times, first time, I skim read, then 2nd time I read deeply and make notes, then 3rd time, I go over everything. Its like reading a book by starting at the end, sometimes just the act of skimming the manual gives you heads up. Especially, when in 10 pages, it says "now, you can omit steps 1-10000000000 if you just do this"  Andre'
|
| Tue Aug 21, 2012 1:23 am |
|
 |
|
Boro
Joined: Fri Jun 01, 2012 8:00 am Posts: 63 Location: Gospić Croatia
|
 Re: Arduino communication problem
I usually just flip through every page when I get a new book. For certification exams I read the whole thing as quickly as possible to get an idea how much I have to learn, then go in and study the areas I find I need to and then check with a practice test and study where Im weak. Kind of like your method. When it comes to programming I usually slowly go through each chapter practising each new thing. Only problem is it takes ages and maybe your method is better. Business/marketing books usually read once taking notes and thats it. Over 300 books read and most 300 page books (except uni text books) have only 10-20 pages of useful information the rest is padding and repeating. I took your advice at the start of the manual and did go through the whole manual quickly. Only problem is when i come on here with a problem my knowledge isnt thorough enough. I feel i need to now read the propellor manual because of SPIN before I should read your manual again so I can understand the driver code better. Your AVR stuff is clear. 
|
| Tue Aug 21, 2012 11:56 pm |
|
 |
|
|
Page 1 of 1
|
[ 17 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 1 guest |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|