Show Posts
Pages: [1] 2 3
1  Using Arduino / Installation & Troubleshooting / Re: Bootloading Atmega328p-pu with USBTiny AVR Pocket Programmer on: October 12, 2012, 07:05:59 pm
No, not swapped.  Again, I can successfully receive Serial data from the 328 through the FT232R on COM4 onto the Serial Monitor in Arduino IDE.  So, they must be correct.  Plus I double checked anyway.
 
2  Using Arduino / Installation & Troubleshooting / Re: Bootloading Atmega328p-pu with USBTiny AVR Pocket Programmer on: October 12, 2012, 06:03:29 pm
I also added a diode IN4148 from Reset to 5V. Leaving the 100nF cap in series from DTR to Reset and 10k pullup.
 Same result.
3  Using Arduino / Installation & Troubleshooting / Re: Bootloading Atmega328p-pu with USBTiny AVR Pocket Programmer on: October 12, 2012, 05:57:33 pm
OK,
I hooked up a 100nF cap in series from the FT232R DTR to the 328 pin1 Reset.  A 10k is still pulling up 328 pin1 to 5V.  Still same error from IDE...
Code:
avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\arduino-1.0\hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : \\.\COM4
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv: . [00]
avrdude: stk500_getsync(): not in sync: resp=0x00

avrdude done.  Thank you.
4  Using Arduino / Installation & Troubleshooting / Re: Bootloading Atmega328p-pu with USBTiny AVR Pocket Programmer on: October 12, 2012, 04:31:18 pm
CrossRoads and Lefty,

I think you both are coming to a similar conclusion which I will test.
As previously noted, this shows pretty much exactly my layout http://itp.nyu.edu/physcomp/uploads/arduinobload_wires.jpg except for the screw up in the MOSI line.
On the FT232R I am not using the RTS or DTR line at all going to the Atmega328 chip.  However, the Reset on the Atmega328 is pulled to 5V with a 10k and a manual reset button as shown.

Should the FT232R's RST line run to the Atmega328 reset, pin1?
And should I go ahead and add the 100nF cap between DTR and RST on the FT232R?

I think I get it that I have no reset running over to the Atmega328, as it IS running over from my breakout board to the Pocket Programmer, as shown in the image.

5  Using Arduino / Installation & Troubleshooting / Re: Bootloading Atmega328p-pu with USBTiny AVR Pocket Programmer on: October 12, 2012, 01:46:08 pm
Lefty,

Thanks.  This clears up some details for me.
As you explained, the second newer method is working fine for me.  However, as to the first method, I bootloaded the optiboot.hex bootload to my Atmega328p-pu which I understand to be the bootload for a typical Uno.  I also set the fuses according to the Uno.  And I have the neccesary 16Mhz exteranl clock and all.
 By doing so, I would assume that selecting the "Arduino Uno" as my board type in the IDE would satisfy the necessary conditions to allow uploading of a sketch to work.  This is what I have tried, but fails.
Am I still missing something?
6  Using Arduino / Installation & Troubleshooting / Re: Bootloading Atmega328p-pu with USBTiny AVR Pocket Programmer on: October 12, 2012, 12:54:43 pm
Lefty,

Thanks, but I am a little confused by your comment.  Help me understand please.

In my current situation I want to simply sketch-load rather than boot-load.  (I'm not sure if there is really a fundamental difference in this designation in the IDE, but my brain is wired to think like that for the moment.)  But for the sake of argument, I can do neither from the IDE through my FT232R, so I understand that the issue is likely the same either way.  
So when you say "The baud rate a specific bootloader uses is 'hard coded' into the bootloader code", are you meaning that the baud rate a specific device, in my case the FT232R, used for either boot or program loading is hard coded?
Secondly, you said "the IDE looks at the boards.txt file and uses the baud rate value from the selected board entry in that file for the board selection choice you had set in the IDE".  
So, is it important that the baud rate listed in the boards.txt match what is hard coded in the bootloader device?

 
7  Using Arduino / Installation & Troubleshooting / Re: Bootloading Atmega328p-pu with USBTiny AVR Pocket Programmer on: October 12, 2012, 09:50:51 am
CrossRoads,

Thanks for the reply.  I was starting to think I was alone in the world.
With Optiboot loaded on the chip, I have Uno selected but still cannot successfully load a sketch from Arduio IDE through the FT232R, even though the FT232R shows up as COM4 and COM4 is selected and I can get serial Read/Write through the FT232R on COM4.

When I load a sketch using avrdude, I have to use the "-B 32" or "-B 16" flag, as a "-B 1" setting results in a "initialization failed, rc=-1" error in avrdude.
I don't know how to control these types of options when Arduino IDE uploads sketches, as Arduino is simply using its own avrdude also.  I might be wrong, but it seems like if I can dictate the bit clock period when Arduino transfers, that maybe it would work.
Also a question of mine, in general, my COM4 is set to 9600 baud but in the "boards.txt" the uno.upload.speed=115200.  Is that a right?  I tried to lower this to 19200 but no change.

8  Using Arduino / Installation & Troubleshooting / Re: Bootloading Atmega328p-pu with USBTiny AVR Pocket Programmer on: October 12, 2012, 07:57:05 am
I can use the "Upload using Programmer", if I have the usbtiny selected in the Arduino IDE. 
So I guess for now I can give up on using the FT232R breakout to load sketches.  Otherwise, I will just use it for reading serial output for debug.
9  Using Arduino / Installation & Troubleshooting / Re: Bootloading Atmega328p-pu with USBTiny AVR Pocket Programmer on: October 11, 2012, 12:35:40 pm
On the road to determine why I get "stk500_getsync(): not in sync: resp=0x00" when I try to load a sketch from Arduino 1.0 IDE interface....

I still get this message when trying to upload a sketch.
However, if I load the following modified Blink sketch, using still avrdude to upload through the Pocket Programmer...

Code:
void setup() {     
  Serial.begin(9600);   
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(13, OUTPUT);     
}

void loop() {
  digitalWrite(13, HIGH);   // set the LED on
  Serial.println("High");
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // set the LED off
  Serial.println("Low");
  delay(1000);              // wait for a second
}

I can then see if I receive Serial (COM4) messages through the FT232R Breakout board, on COM4.
And I do.
So I can read Serial messaging through the FT232R, but I just cannot upload a sketch.

Go figure.
10  Using Arduino / Installation & Troubleshooting / Re: Bootloading Atmega328p-pu with USBTiny AVR Pocket Programmer on: October 11, 2012, 11:06:38 am
OK, I'm learning.

Set the fuses to:
avrdude -c usbtiny -B 16 -p m328p -U lfuse:w:0xFF:m -U hfuse:w:0xDE:m -U efuse:w:0x05:m

And the LED blinks at the proper rate, using my external 16MHz crystal.

Still need any input on my issue using Arduino IDE through the FT232R.

Thanks
11  Using Arduino / Installation & Troubleshooting / Re: Bootloading Atmega328p-pu with USBTiny AVR Pocket Programmer on: October 11, 2012, 10:19:05 am
OK,
I can upload the Blink.cpp.hex using avrdude through the AVR Pocket Programmer, BUT I still cannot get it from the Arduino 1.0 interface through the FT232R USB breakout board.
Either way, I seem to have a path that works, not the most convenient, but works.

Now, however, the LED seems to blink about 10 times slower than the 1 sec delay in the program.

Now, can someone tell me why this is?

Thanks,
12  Using Arduino / Installation & Troubleshooting / Re: Bootloading Atmega328p-pu with USBTiny AVR Pocket Programmer on: October 11, 2012, 09:22:08 am
OK,
I found my issue with the Bootloading part.
There is an error in the picture in the instructions at:
http://itp.nyu.edu/physcomp/uploads/arduinobload_wires.jpg
If you look closely at this picture, it shows the MOSI from the Breakout Board going to Pin 16 of the Atmega.  THIS SHOULD BE GOING TO Pin 17 instead.

Now, with..
avrdude -c usbtiny -B 32 -pm328p -U flash:w:optiboot_atmega328.hex
I get the following result.

Code:
C:\>avrdude -c usbtiny -B 32 -pm328p -U flash:w:optiboot_atmega328.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x1e950f
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed

         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "optiboot_atmega328.hex"
avrdude: input file optiboot_atmega328.hex auto detected as Intel Hex
avrdude: writing flash (32768 bytes):

Writing | ################################################## | 100% 45.89s



avrdude: 32768 bytes of flash written
avrdude: verifying flash memory against optiboot_atmega328.hex:
avrdude: load data flash data from input file optiboot_atmega328.hex:
avrdude: input file optiboot_atmega328.hex auto detected as Intel Hex
avrdude: input file optiboot_atmega328.hex contains 32768 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 43.57s



avrdude: verifying ...
avrdude: 32768 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.


However, I am still not able to load a sketch to the chip using ArduinoIDE 1.0
I get the following....
Code:
avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\arduino-1.0\hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : \\.\COM4
         Using Programmer              : arduino
         Overriding Baud Rate          : 19200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv:
avrdude: stk500_getsync(): not in sync: resp=0x00

avrdude done.  Thank you.

A little progress, but no sketches yet.  Any ideas?
I can try uploading sketches through avrdude maybe.
13  Using Arduino / Installation & Troubleshooting / Re: Bootloading Atmega328p-pu with USBTiny AVR Pocket Programmer on: October 11, 2012, 08:36:58 am
As an added note:
I tried to set the fuses only, using
avrdude -c usbtiny -p m328p -C -U lfuse:w:0xFF:m -U hfuse:w:0xDE:m -U efuse:w:0x05:m

however, it just did not seen to take.

14  Using Arduino / Installation & Troubleshooting / Re: Loading Sketches Problem with Mega2560 and Ethernet Shield on: October 10, 2012, 12:59:33 pm
Alberto,

Thanks for that.  I used an external power source and it works fine now.

DG
15  Development / Other Software Development / Re: New fast digital I/O and Software SPI libraries on: October 10, 2012, 10:35:36 am
fatlib16,

Thanks for the reply.  I am looking at the pins with a digital scope.  I can try your test, but I see no transitions in the pin signals.
Consequently, I ended up making my own library "SW_SPI.h" and it seems to be working fine, but I was hoping to take more advantage of your fast digitalpin functions.  But this may be OK anyway, as I am sending my SPI over an RS485 hardware protocol, over 10 meters, so I may not be able to go full bore speed anyway.
Thanks,
Pages: [1] 2 3