Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] JTAG

2005-04-28 by Richard Duits

The Keil can use the DCC (Debug Communications Channel) to show debug 
messages in a terminal window during debugging. I wrote the following 
functions to handle the DCC comminication:

static inline int DCC_TxEmpty(void)
{
  int DccControl;
  asm volatile("mrc\t" "14, 0, %0, c0, c0": "=r" (DccControl));
  return (DccControl & 2) == 0;
}

static inline void DCC_TxData(int Data)
{
  while (! DCC_TxEmpty()) { }
  asm volatile("mcr\t" "14, 0, %0, c1, c0": : "r" (Data));
}

void DCC_SendString(const char *Buffer)
{
  register const unsigned char *P;
  P = (const unsigned char *) Buffer;

  if (Buffer)
  {
    while (*Buffer)
    {
      DCC_TxData(*P);
      ++P;
    }
  }
}

static inline int DCC_RxAvail(void)
{
  UINT DccControl;
  asm volatile("mrc\t" "14, 0, %0, c0, c0": "=r" (DccControl));
  return (DccControl & 1) != 0;
}

static inline int DCC_RxData(void)
{
  int Data;
  while (! DCC_RxAvail()) { }
  asm volatile("mrc\t" "14, 0, %0, c1, c0": "=r" (Data));
  return Data;
}






Sridhar gadda wrote:

> Hello,
>
>           does any one read register values trough JTAG. In Blinky 
> example (keil) UART has been used to display result of value stored in 
> register on hyper terminal. Is it possible in same way using JTAG ??. 
> Any example help would be greatly appreciated. I am using ULINK.
>
> thanks,
>
> Sridhar
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> [Non-text portions of this message have been removed]
>
>
> ------------------------------------------------------------------------
> *Yahoo! Groups Links*
>
>     * To visit your group on the web, go to:
>       http://groups.yahoo.com/group/lpc2000/
>        
>     * To unsubscribe from this group, send an email to:
>       lpc2000-unsubscribe@yahoogroups.com
>       <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>        
>     * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.