AVR ATmega1284p JTAG per Software diasabeln

#3941117
Lesenswert?
• ▲
▼
MCUCR Bit 7  JTD
1
Bits 7 – JTD: JTAG Interface Disable
2
When this bit is zero, the JTAG interface is enabled if the JTAGEN Fuse is programmed. If this
3
bit is one, the JTAG interface is disabled. In order to avoid unintentional disabling or enabling of
4
the JTAG interface, a timed sequence must be followed when changing this bit: The application
5
software must write this bit to the desired value twice within four cycles to change its value. Note
6
that this bit must not be altered when using the On-chip Debug system.
OP #3941132
Lesenswert?
• ▲
▼
holger schrieb:
> Datenblatt öffnen, auf Suche gehen und JTAG eingeben.
> Dann wirst du die Stelle schon finden;)

witzig, das hatte ich zuerst getan, aber nicht wirklich verstanden was 
die da faseln, ein einfach ja hätte gereicht
1
MCUCR
2

3
10.12.2 MCUCR – MCU Control Register
4
Note: 1. Only available in the Atmel ATmega164PA/324PA/644PA/1284P.
5
• Bit 6 – BODS: BOD Sleep
6
The BODS bit must be written to logic one in order to turn off BOD during sleep, see Table 10-1 on page 42.
7
Writing to the BODS bit is controlled by a timed sequence and an enable bit, BODSE in MCUCR. To disable
8
BOD in relevant sleep modes, both BODS and BODSE must first be set to one. Then, to set the BODS bit,
9
BODS must be set to one and BODSE must be set to zero within four clock cycles.
10
The BODS bit is active three clock cycles after it is set. A sleep instruction must be executed while BODS is
11
active in order to turn off the BOD for the actual sleep mode. The BODS bit is automatically cleared after three
12
clock cycles.
13
• Bit 5 – BODSE: BOD Sleep Enable

kein Wort über Bit 7

Bit 7 ist JTD

und
1
10.11.7 On-chip Debug System
2
If the On-chip debug system is enabled by the OCDEN Fuse and the chip enters sleep mode, the main clock
3
source is enabled, and hence, always consumes power. In the deeper sleep modes, this will contribute
4
significantly to the total current consumption.
5
There are three alternative ways to disable the OCD system:
6
. Disable the OCDEN Fuse
7
. Disable the JTAGEN Fuse
8
. Write one to the JTD bit in MCUCR

also brauche ich nur das Bit setzen?

Das ist die dünnste Erklärung die ich in den Atmel Blättern je sah, 
deswegen frage ich ja hier.

und der Namenswechsel von JTAG zu OCD war auch nicht hilfreicher zum 
Verständnis.
Gast #3941138
Lesenswert?
• ▲
▼
> kein Wort über Bit 7

Doch, musst nur an der richtigen Stelle schauen (nämlich da wos 
dokumentiert ist):
1
Bits 7 – JTD: JTAG Interface Disable
2
When this bit is zero, the JTAG interface is enabled if the JTAGEN Fuse is programmed. If this bit is one, the
3
JTAG interface is disabled. In order to avoid unintentional disabling or enabling of the JTAG interface, a timed
4
sequence must be followed when changing this bit: The application software must write this bit to the desired
5
value twice within four cycles to change its value. Note that this bit must not be altered when using the On-chip
6
Debug system.

HTH
OP #3941153
Lesenswert?
• ▲
▼
Detlef Kunz schrieb:
> Beitrag "AVR ATmega1284p JTAG per Software diasabeln"

hatte ich abgeschickt und nicht wiedergefunden, dachte mein Browser 
spinnt.

g457 schrieb:
> Doch, musst nur an der richtigen Stelle schauen

g457 schrieb:
> When this bit is zero, the JTAG interface is enabled if the JTAGEN Fuse
> is programmed.



ich verstehe es nicht,

normalerweise schalte ich das JTAG immer per ISP aus, entweder ich habe 
es vergessen oder den Chip verfused

angenommen JTAG ist per ISP enabled, dann sollte das helfen, tuts aber 
nicht
  MCUCR|=(1<<JTD);
  DDR_KWEISS |= (1<<KWEISS);
  KWEISS_OFF;

kalt weisse LED leuchtet prächtig

angenommen JTAG ist per ISP disabled,
warum leuchtet die immer?

und das betrifft alle Pins TDI TDO TMS und TCK eben alle die mit OCD 
oder JTAG zu tun haben.
#3941161
Lesenswert?
• ▲
▼
WICHTIG!!!
1
The application software must write this bit to the desired
2
value twice within four cycles to change its value.
Du must zweimal hindereinander das Bit setzen, am besten in Assembler 
und Interrupts ausgeschaltet dabei, damit der Vorgang nicht unterbrochen 
wird.
1
in r16,MCUCR
2
ori r16,0x80
3
cli
4
out MCUCR,r16
5
out MCUCR,r16
6
sei

Antwort schreiben

Hinweis: der ursprüngliche Beitrag ist mehr als 6 Monate alt. Bitte hier nur auf die ursprüngliche Frage antworten, für neue Fragen einen neuen Beitrag erstellen.

Formatierung
  • [c]C-Code[/c]
  • [code]Code in anderen Sprachen, ASCII-Zeichnungen[/code]
  • [math]Formel in LaTeX-Syntax[/math]
  • [[Titel]] – Link zu einem Artikel
  • Verweis auf einen anderen Beitrag: Rechtsklick auf dessen Beitrags-ID (#8078628), „Adresse kopieren“, in den Text einfügen

Mehr zur Formatierung

Längeren Sourcecode als Anhang, nicht in den Text. JPG nur für Fotos und Scans; Zeichnungen und Screenshots als PNG oder GIF. Siehe Bildformate.

Schon registriert? Anmelden

Wird nicht angezeigt. Wir schicken dir einen Link; sobald du damit bestätigst, erscheint dein Beitrag.

Mit dem Abschicken legst du einen kostenlosen Account an und erkennst die Nutzungsbedingungen und die Datenschutzerklärung an.