[En-Nut-Discussion] U R G E N T !!! Ethernut 1 -using PORTF

Alexander Baranov baranov at intech21.com
Mon Mar 10 18:24:07 CET 2008


Hello, Henrik.
Where does the     _SFR_IO_ADDR(JTAG_REG   come from? My WinAVR-2005 
compiler does not see it.
Alexander.


----- Original Message ----- 
From: "Henrik Maier" <hmlists at focus-sw.com>
To: "'Ethernut User Chat (English)'" <en-nut-discussion at egnite.de>
Sent: Monday, March 10, 2008 1:32 AM
Subject: Re: [En-Nut-Discussion] U R G E N T !!! Ethernut 1 -using PORTF


>> -----Original Message-----
>> disable your programmer. Right now I can't find the right register name,
>> but you should disable JTAG in your application. This way it is enabled
>> again after pressing reset.
>>
>> Harald
>>
>
> The register concerned is the JTAG_REG and the bit is the JTD bit.
>
> That's the code sequence I use to turn off JTAG by software (not fuse 
> bits!)
> and to read from port F into the variable "reg":
>
> void postExecute()
> {
>   uint8_t reg;
>
>   ...
>   //
>   // Disable JTAG for a short moment
>   //
>   cli();
>   DDRF |= 0xF0; // Make them inputs
>   PORTF |= 0xF0; // Enable pull-up
>   __asm__ __volatile__(
>      "in r24, %0"  "\n\t"
>      "ori r24, 1 << %1" "\n\t"
>      "out %0, r24" "\n\t"
>      "out %0, r24" "\n\t"
>      "nop" "\n\t"
>      "nop" "\n\t"
>      "nop" "\n\t"
>      "nop" "\n\t"
>        :
>        : "i" (_SFR_IO_ADDR(JTAG_REG)),
>          "i" (JTD)
>        : "r24"
>    );
>   reg = PINF;
>   __asm__ __volatile__(
>      "in r24, %0"  "\n\t"
>      "andi r24, ~(1 << %1)" "\n\t"
>      "out %0, r24" "\n\t"
>      "out %0, r24" "\n\t"
>        :
>        : "i" (_SFR_IO_ADDR(JTAG_REG)),
>          "i" (JTD)
>        : "r24"
>    );
>   sei();
>   ...
> }
>
> Use at your own risk!
>
> Cheers
>
> Henrik
> http://www.proconx.com
>
>
>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
> 




More information about the En-Nut-Discussion mailing list