Thanks for that.

However the approach I mentioned earlier works fine as well, even if it
takes 3 clocks per assignment, since you are supposed to write the
JTD bit twice within 4 clocks.

Omar

On Thu, Jan 5, 2012 at 7:31 AM, Joerg Wunsch <j...@uriah.heep.sax.de> wrote:
> Omar Choudary <choudary.o...@gmail.com> wrote:
>
>> Sorry for writing too early.
>
> In that case, it makes sense to either write the value
> directly:
>
>  MCUCR = _BV(JTD);
>  MCUCR = _BV(JTD);
>
> (usually, you are expected to know the entire contents of that
> register at this point ;-), or use a temporary variable rather than |=
> directly on MCUCR:
>
>  uint8_t tmpval = MCUCR;
>  tmpval |= _BV(JTD);
>  MCUCR = tmpval;
>  MCUCR = tmpval;
>
> The |= requests MCUCR to be read and written back each time (due to
> its volatileness).
> --
> cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL
>
> http://www.sax.de/~joerg/                        NIC: JW11-RIPE
> Never trust an operating system you don't have sources for. ;-)
>
> _______________________________________________
> AVR-GCC-list mailing list
> AVR-GCC-list@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/avr-gcc-list

_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to