summaryrefslogtreecommitdiffstats
path: root/tests/top2049/atmega8dip28.test
blob: 5d5ec19f8577879cf80c2e1f88d29afa67c48d70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh

test_init()
{
	request_DUT "atmega8dip28" || return 1
	return 0
}

test_run()
{
	# Check signature
	toprammer --read-sig "$tmpfile"
	compare_file_to_hex "$tmpfile" "1E9307" || die "signature mismatch"

	toprammer --erase

	# Check progmem
	toprammer --write-prog "$testfile_8k"
	toprammer --read-prog "$tmpfile"
	compare_files "$testfile_8k" "$tmpfile" || die "progmem mismatch"

	# Check EEPROM
	toprammer --write-eeprom "$testfile_512"
	toprammer --read-eeprom "$tmpfile"
	compare_files "$testfile_512" "$tmpfile" || die "EEPROM mismatch"

	# Check fuses
	testfuses="E1D9"
	echo "0x0000: $testfuses" | toprammer -I hex --write-fuse -
	toprammer --read-fuse "$tmpfile"
	compare_file_to_hex "$tmpfile" "$testfuses" || die "fuses mismatch"

	# Check lockbits
	toprammer --read-lock "$tmpfile"
	compare_file_to_hex "$tmpfile" "FF" || die "lockbits mismatch"
	toprammer --write-lock "$tmpfile"
}
bues.ch cgit interface