Subversion Repositories svnkaklik

Rev

Rev 134 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 134 Rev 409
1
#!/bin/sh 
1
#!/bin/sh 
2
prg="adude"
2
prg="adude"
3
if [ "$1" = "-u" ]; then
3
if [ "$1" = "-u" ]; then
4
	shift;
4
	shift;
5
	prg="uisp"
5
	prg="uisp"
6
fi
6
fi
7
if [ -z "$1" -o "$1" = "-h" -o "$1" = "--help" ]; then
7
if [ -z "$1" -o "$1" = "-h" -o "$1" = "--help" ]; then
8
	echo "prg_read_uc -- read the flahs of an atmega8 microcontroller"
8
	echo "prg_read_uc -- read the flahs of an atmega8 microcontroller"
9
	echo ""
9
	echo ""
10
	echo "Usage: prg_load_uc [-hu] File.hex"
10
	echo "Usage: prg_load_uc [-hu] File.hex"
11
	echo ""
11
	echo ""
12
	echo "OPTIONS: -h this help"
12
	echo "OPTIONS: -h this help"
13
	echo "         -u use uisp instead of avrdude"
13
	echo "         -u use uisp instead of avrdude"
14
	echo "            avrdude can automatically detect dapa or avrusb500."
14
	echo "            avrdude can automatically detect dapa or avrusb500."
15
	echo "            uisp can only be used with the parallel port dapa."
15
	echo "            uisp can only be used with the parallel port dapa."
16
	echo ""
16
	echo ""
17
	echo "This script can be easily adapted to different programmer types"
17
	echo "This script can be easily adapted to different programmer types"
18
	exit 0
18
	exit 0
19
fi
19
fi
20
pfile="$1"
20
pfile="$1"
21
 
21
 
22
if [ "$prg" = "uisp" ]; then
22
if [ "$prg" = "uisp" ]; then
23
	set -x
23
	set -x
24
	#uisp -dlpt=/dev/parport0 --erase  -dprog=dapa
24
	#uisp -dlpt=/dev/parport0 --erase  -dprog=dapa
25
	#uisp -dlpt=/dev/parport0 --upload if="$pfile" -dprog=dapa  -v=3 --hash=32 --verify
25
	#uisp -dlpt=/dev/parport0 --upload if="$pfile" -dprog=dapa  -v=3 --hash=32 --verify
26
	set +x
26
	set +x
27
fi
27
fi
28
if [ "$prg" = "adude" ]; then
28
if [ "$prg" = "adude" ]; then
29
	if grep "Vendor=0403 ProdID=6001" /proc/bus/usb/devices > /dev/null ; then
29
	if grep "Vendor=0403 ProdID=6001" /proc/bus/usb/devices > /dev/null ; then
30
		set -x
30
		set -x
31
		avrdude -v -v -p m8 -c avrusb500 -U flash:r:"$pfile:i"
31
		avrdude -v -v -p m8 -c avrusb500 -U flash:r:"$pfile:i"
32
		set +x
32
		set +x
33
	else
33
	else
34
		set -x
34
		set -x
35
		avrdude -p m8 -c dapa -U flash:r:"$pfile:i"
35
		avrdude -p m8 -c dapa -U flash:r:"$pfile:i"
36
		set +x
36
		set +x
37
	fi
37
	fi
38
fi
38
fi