Jump to content
Intermodellbau 2024: Unser Stand in Halle 3 ist fertig für Besucher - schaut mal 'rein. ×
Schiffsmodell.net

ATMega 16 zum Schweigen gebracht


Time Bandit

Recommended Posts

Hallo zusammen,

nachdem ich heute mal wieder ein wenig am Evaluationsboard rumgespielt habe, stehe ich nun vor einem Problem, nichts geht mehr :mrgreen:.

 

Ich habe mir ein kleines Programm geschrieben, mit welchem ich die Impulslänge von einem Kanal auslesen kann und die dann auf den LCD geworfen wird.

Dabei habe ich den Empfänger mittels den 5V vom Board versorgt und den Signaleingang direkt auf PA1 gelegt.

Das Ganze sieht dann so aus.

 

'======================================================
'Definition für Mega 16
$regfile "m16def.dat"
'Angabe der Taktfrequenz (1Mhz)
$crystal = 1000000


'======================================================
'Konfigurationen
'======================================================
'Ein- und Ausgänge festlegen
Config Porta.1 = Input
'LCD Konfiguration
Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = Portb.7 , E = Portb.2 , Rs = Portb.0
Config Lcd = 20 * 2

'======================================================
'Variablen-Deklarationen
'======================================================
Dim Pulsbreite As Word
Dim Ausgabewert As Word
'======================================================
'Einmalige Aktionen vor Hauptprogramm
'======================================================
'Das LCD-Display vorbereiten
Cursor Off
Cls
Lcd "***Kanal 1******"

'*******************************************************************************
'* HAUPTPROGRAMM                                                               *
'*******************************************************************************

Do
Bitwait Pina.1 , Set

  Pulsein Pulsbreite , Pina , 1 , 1                        'Pulsbreite auslesen

  If Pulsbreite < 250 Then Ausgabewert = Pulsbreite
  Cls                                                      ' LCD Ausgabe
  Lcd "Pulslaenge: "
  Lcd Ausgabewert


Loop

'-------------------------------------------------------------------------------
'===
End
'===

Das hat auch wunderbar funktioniert, ABER die Pulsbreiten haben nicht gestimmt (Schwankung zwischen 30 und 70, statt zwischen 100 und 200) und zwischendrin gabs immermal wieder Störsignale mit > 1000.

 

Deswegen habe ich mal vermutet, dass da irgendwas mit den Fuses nicht stimmt. Also ein bissl an den Fuses rumgespielt um z.B. die Taktfrequenz auf 8 Mhz zu erhöhen.

Plötzlich war der Mega16 tot...

Meine Vermutung, ich habe da irgendwie auf nen externen Quarz umgestellt oder so.

 

Also im Moment kann ich nichtmal Fuses lesen.

 

Also gedacht, okay Lehrgeld bezahlt, man spielt an den Fuses nicht rum, sondern überlegt sich vorher was man tut :cluebat:

 

Anderen Mega16 reingesteckt.

Dort kann ich auch Fuses lesen und einstellen, ABER ich kann kein Programm mehr auf den µC schreiben. Nicht mal mehr das Boardtest.hex.

 

 

Fehlertext ist wie folgt:

C:\Programme\WINAVR\bin\avrdude.exe -u -C C:\Programme\WINAVR\bin\avrdude.conf -p m16 -P com3 -c stk500v2 -E reset,novcc  -U flash:w:F:\MoBa\Elektronik\2012 ATMEL Tutorial\20121022 Testprogramme\Boardtest.hex:a 
avrdude.exe: WARNING: -E option not supported by this programmer type

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e9403
avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be performed
            To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: reading input file "F:\MoBa\Elektronik\2012 ATMEL Tutorial\20121022 Testprogramme\Boardtest.hex"
avrdude.exe: input file F:\MoBa\Elektronik\2012 ATMEL Tutorial\20121022 Testprogramme\Boardtest.hex auto detected as Intel Hex
avrdude.exe: writing flash (1404 bytes):

Writing | ####avrdude.exe: stk500v2_command(): unknown status 0x80
avrdude.exe: stk500v2_paged_write: write command failed
############################################## | 100% 1.63s

avrdude.exe: 1404 bytes of flash written
avrdude.exe: verifying flash memory against F:\MoBa\Elektronik\2012 ATMEL Tutorial\20121022 Testprogramme\Boardtest.hex:
avrdude.exe: load data flash data from input file F:\MoBa\Elektronik\2012 ATMEL Tutorial\20121022 Testprogramme\Boardtest.hex:
avrdude.exe: input file F:\MoBa\Elektronik\2012 ATMEL Tutorial\20121022 Testprogramme\Boardtest.hex auto detected as Intel Hex
avrdude.exe: input file F:\MoBa\Elektronik\2012 ATMEL Tutorial\20121022 Testprogramme\Boardtest.hex contains 1404 bytes
avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 0.25s

avrdude.exe: verifying ...
avrdude.exe: verification error, first mismatch at byte 0x0000
            0x0c != 0x00
avrdude.exe: verification error; content mismatch

avrdude.exe done.  Thank you.

Einstellung am Burn-O-MAT etc habe ich alle überprüft.

Hat sonst noch jemand Ideen?

 

 

 

EDITH:

Der "tote" Mega16 gibt beim Fuses lesen folgendes heraus:

C:\Programme\WINAVR\bin\avrdude.exe -u -C C:\Programme\WINAVR\bin\avrdude.conf -p m16 -P com3 -c stk500v2 -E reset,novcc  -U hfuse:r:C:\DOKUME~1\Tobi\LOKALE~1\Temp\hfuse7273769106819062265.hex:r -U lfuse:r:C:\DOKUME~1\Tobi\LOKALE~1\Temp\lfuse8808471868744439209.hex:r 
avrdude.exe: WARNING: -E option not supported by this programmer type

avrdude.exe: stk500v2_command(): command failed
avrdude.exe: stk500v2_command(): unknown status 0xc9
avrdude.exe: stk500v2_program_enable(): cannot get connection status
avrdude.exe: initialization failed, rc=-1
            Double check connections and try again, or use -F to override
            this check.


avrdude.exe done.  Thank you.

Edited by Time Bandit
Link to comment

Nach etwas Googelei (was ein Wort), habe ich zumindest eine Lösung für das Problem gefunden, dass sich der i.O.-µC nicht mehr beschreiben lässt.

 

Einfach bei den AVR-DUDE Settings in die Kommadozeile -B10 dazuschreiben...fragt mich nun nicht genau was das macht, es funktioniert :bäh:

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.