I need to program usint UISP but I can't get it to install. I can't get it to make in Cygwin b/c I have no C compilers. I tried installing GCC but I get get past the make (again now compilers) I tried reading the UISP site, but it's not to informative... I can't use AVRstudio b/c it has no parallel option and I can't install GCC b/c I have to C compliler... What do I do? Are there any easier ways of doing this?
Trouble Running Cygwin and UISP
Do you have to use UISP? avdude is more up to date, and it's included in the winavr distribution. No need to compile...
I'm not sure, does avrdude allow me to program over my parrallel port, using a direct connection, without the use of a PPPD? (Parallel Port Programing Dongle?)
I haven't used any parallel port programmer, but the first google hit for 'avdrude':
http://www.bsdhome.com/avrdude/
suggests that it is indeed possible to get away with a very simple setup.
I have installed various versions of the winavr distribution with no problems of any kind.
avrdude supports *everything* UISP used to support, plus a lot more.
okay, so how do I install it in Windows, it only has tar.gz packages. Which I know from experience are for linux...
Are you using WinAVR as a C compiler? If so, then you should be using either the most recent version (20070122) or, if you're wary of the relatively immature state of GCC 4.x for the AVR target, the previous version (20060421) with a mature release of GCC 3.4.6.
Either of these releases of WinAVR come with Windows binaries of avrdude.
Or if you prefer, since you have Cygwin installed, you could compile the tar.gz source files into Windows executables using Cygwin's Win32-GCC compiler.
Yes I'm using PN to compile, but after I compile, How do I program the device? I have the Power supply, I have the Paralell Cable etc. I just see no way within the PN to send this hex file to my ATmega...
EDIT:
Okay, now I'm using avrdude through Cygwin. Now, I have an ATmega16 with a 4MHz Crystal, what do I put in for the command line in order to program this sucker
$ avrdude -p atmega16 ?????
here's what I got:
Ryan@sharonapple ~ $ avrdude -p m16 -c dapa avrdude.exe: can't open device "giveio" avrdude.exe: failed to open parallel port "lpt1"
Install the giveio.sys driver that comes along with avrdude in WinAVR.
Unless you know what you're doing, don't roll your own.
If you're using the WinAVR Makefile template, it already has hooks
for programming through avrdude, so all you need to say is "make
program".
I see... I copied over the giveio.sys from the WinAVR /bin over to the Cygwin /bin directory and got the same error, however I only tried this quickly before heading out. I haven't tried restarting Cygwin yet. I'll try it when I get home.
It is possible (probably preferable) to use WinAVR without Cygwin. All of the tools provided with WinAVR will work directly from a DOS prompt within Windows.
If you really like the environment, WinAVR also comes with its own minimal set of GNU utilities, including its own bash shell.
Are you using Cygwin for any other purpose on your computer? If not, I'd recommend ditching it.
Aww, that I didn't know. so I can just use the standard DOS command line. okay. so yeah that will make my life a lot easier. (*ditches Cygwin*). Right now I'm getting the PortableWinAVR to make my life a little easier I should be able to get back with my progress in a couple of hours...
Things seem to be going smoothly with this Portable WinAVR I just need some definitions on the folowing programmers as per the avrdude -c command. Which one do I select for direct lpt port programming?
> Which one do I select for direct lpt port programming?
The one matching your programmer hardware. AVRDUDE supports about
a dozen of them... As you came from UISP, my guess is it's -c dapa.
Just have a look at the wiring for each programmer type in
avrdude.conf.
"avrdude" -p m16 -c bsd -P lpt1 -U eeprom:w:"L:\PROJECTS\WT\avrledtest.hex":a
I'm using that command line, and I get this error:
avrdude: AVR device not responding
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
and when I do override I get writing failed errors. I've triple-checked the wiring as well, it's pretty basic so I doubt I messed it up...
btw thanks a lot for your help thus far.
EDIT:
Almost forgot, where is this "con" file avrdude is writing I can't seem to find it.
> "avrdude" -p m16 -c bsd ...
> I'm using that command line, and I get this error:
Why are you trying to use the "bsd" programmer type, when I already
wrote you that most likely, you need the "dapa" programmer type?
There's plenty of options how you could connect a simple bit-bang ISP
adapter to a parallel port, that's why there's a dozen of different
programmer types in that class. Obviously, when you select the wrong
wiring, it cannot work.
> Almost forgot, where is this "con" file avrdude is writing I can't
> seem to find it.
It's not a "con" file, and it's not being written by avrdude. It's a
configuration file named avrdude.conf. Have your operating system
search for it within the WinAVR installation directory.
p.s.:
> -U eeprom:w:"L:\PROJECTS\WT\avrledtest.hex":a
I guess this is actually your code file, not the EEPROM load
file... so you'd better load that into the flash ROM:
-U flash:w:"L:\PROJECTS\WT\avrledtest.hex":a
or just
-U "L:\PROJECTS\WT\avrledtest.hex"
I was using the wiring from the avrdude site so I thought i could use that... that's why I was using the bsd, and I followed the wiring in the conf file.
I didn't even notice the dapa in the conf, I'll switch to that now then.
> I was using the wiring from the avrdude site so I thought i could use that...
OK, yes, in that case "bsd" is correct.
If you cannot communicate still, check your printer port settings in BIOS:
pick the "dumbest" mode you can, nothing like "bidirectional", "enhanced",
"ESP" or such.
Yeah it was on ECP, I changed it over to normal, now using the dapa wiring and still same deal, but it can read from the device?... (takes 5.13s when the rest take 0.00s)
"avrdude" -p m16 -c dapa -P lpt1 -U flash:r:"R:\PROJECTS\WT\avrledtest.hex":a -U signature:r:con:r -F R:\Portable\WinAVR\bin>"avrdude" -p m16 -c dapa -P lpt1 -U flash:r:"R:\PROJECTS\WT\avrledtest.hex":a -U signature:r:con:r -F avrdude: AVR device not responding avrdude: initialization failed, rc=-1 avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.00s avrdude: Device signature = 0xffffff avrdude: Yikes! Invalid device signature. avrdude: reading flash memory: Reading | ################################################## | 100% 5.13s avrdude: writing output file "R:\PROJECTS\WT\avrledtest.hex" avrdude: output file R:\PROJECTS\WT\avrledtest.hex auto detected as Intel Hex avrdude: reading signature memory: Reading | ################################################## | 100% 0.00s avrdude: writing output file "con" avrdude: safemode: Fuses OK avrdude done. Thank you.
The output you've posted indicates that you're not actually in communication with the AVR right now.
If you use the wiring pinout listed at the http://www.bsdhome.org/avrdude website, then you really should be using "-c bsd".
Something must be really broken with your hardware, whatever it might be.
It would be best to hook up an oscilloscope, and see what actually happens
at the port pins.
Eureka!
So there's something wrong with the Parallel port on this computer, I tried out programing on my older PC and it worked flawlessly.
Now to figure out what's wrong with this computer, and check out the bios setting for the parallel on my older one.
Thank you everyone for your support and patience
Is this MS Windows?
Did you disable the print spooler?
Yes it's Windows, and no. How do I disable it?
> How do I disable it?
No idea, I'm not a Windows user. Guess somewhere under System Services
or such.
This'll depend on which Windows you have but try Control Panel-Administrative Tools-Services-Print Spooler
Cliff
yeah I figured it out, I haven't touched the services in a long while haha. But still no sucess with the programing :P
If your PC has a floppy drive then maybe try a visit to http://www.bootdisk.com/ and boot to some flavour of MS-DOS to operate with the cleanest, most raw PC possible (I'm assuming the programming app is happy to run in DOS). This rules out all the Windows "unknowns"!
Cliff
avrdude is a Win32 commandline application. It cannot run in "pure" DOS.
Maybe you can massage it enough to be compilable with DJGPP -- a port of GCC which produces "pure" MS-DOS applications which don't rely on the Win32 API and provide their own 32-bit DOS extender and POSIX layer.
But I imagine there would likely need to be be significant code incompatibilities to work through first...
If it has a CD-ROM drive instead, he could boot a Unix variant to get the
cleanest and best organized access to the parallel port. :-)
Either Linux, FreeBSD, or Solaris will do...
well I do have SuSE 10 on this pc, if anyone could walk me through the process I'd give it a try.
Either get a RPM package for avrdude, or compile it yourself.
Source code can be found on
http://download.savannah.gnu.org...
This is a standard procedure, meaning "unpack, configure, make all install clean".
If this doesn't mean anything to you, and 10...15 minutes of googling don't find
it either, ask back here.
Your system must have the "parport" device configured, as the Linux access method
is to use /dev/parportN (N is a number starting at 0 for the first
parallel port that has been found).
linux:/media/REC_FLASH/projects/Cereal_Box/usart # avrdude -p m16 -c bsd -P /dev/parport0 -U flash:w:"/media/REC_FLASH/projects/Cereal_Box/usart/usart.hex":a -F
avrdude: AVR device not responding
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0xffffff
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATMEGA16 is 1E 94 03
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: AVR device not responding
avrdude: reading input file "/media/REC_FLASH/projects/Cereal_Box/usart/usart.hex"
avrdude: input file /media/REC_FLASH/projects/Cereal_Box/usart/usart.hex auto detected as Intel Hex
avrdude: writing flash (354 bytes):
Writing | ################################################## | 100% 0.10s
avrdude: 354 bytes of flash written
avrdude: verifying flash memory against /media/REC_FLASH/projects/Cereal_Box/usart/usart.hex:
avrdude: load data flash data from input file /media/REC_FLASH/projects/Cereal_Box/usart/usart.hex:
avrdude: input file /media/REC_FLASH/projects/Cereal_Box/usart/usart.hex auto detected as Intel Hex
avrdude: input file /media/REC_FLASH/projects/Cereal_Box/usart/usart.hex contains 354 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.07s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0x0c != 0xff
avrdude: verification error; content mismatch
avrdude: safemode: Fuses OK
avrdude done. Thank you.
linux:/media/REC_FLASH/projects/Cereal_Box/usart #
This really boggles me...
EDIT:
Changed wiring and tried again using UISP and dapa same result:
linux:/home/ryan.edwards-crewe/uisp-20050207 # uisp -dprog=bsd An error has occurred during the AVR initialization. * Target status: Vendor Code = 0xff, Part Family = 0xff, Part Number = 0xff Check if the programmer is properly connected. The wiring may be incorrect or target might be 'damaged'. linux:/home/ryan.edwards-crewe/uisp-20050207 # uisp -dprog=dapa An error has occurred during the AVR initialization. * Target status: Vendor Code = 0xff, Part Family = 0xff, Part Number = 0xff Check if the programmer is properly connected. The wiring may be incorrect or target might be 'damaged'. linux:/home/ryan.edwards-crewe/uisp-20050207 #
> avrdude: Device signature = 0xffffff
Your hardware does not communicate at all. There's no point in trying
to force it with -F.
If you want to test your hardware, connect just MISO and MOSI on the
ISP plug, and run avrdude with -vvvv. You are supposed to see the
echo of the programming enable sequence on the MISO line then. As
long as that doesn't work, there's no point in connecting an AVR.
Unfortuntely, our options to help you debugging hardware over the
Internet are quite limited. :^)
> Changed wiring and tried again using UISP and dapa same result:
Btw., there's no point in changing the wiring for that. avrdude
supports all possible wirings that UISP can support, so you only need
to select the matching -c value. Both programs use a fairly different
approach to communicate across the parallel port though (UISP uses
direct IN/OUT instructions, AVRDUDE uses /dev/parportN), so if both
agree in their results, this is a really strong indication the
hardware is the root of your evil.




