All of lore.kernel.org
 help / color / mirror / Atom feed
From: Remco Poelstra <remco.poelstra@duran-audio.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Strange data behaviour
Date: Tue, 17 Feb 2009 12:55:36 +0100	[thread overview]
Message-ID: <499AA5B8.7030805@duran-audio.com> (raw)

Hi,

I'm trying to get my LPC2468 based board to work. I've some problems 
with the external memory databus.
I would like to know the settings of internal registers to see whether 
I've initialized them correctly, so I tried making a function that 
prints the content over the serial link. I'm still in the lowlevel_init 
function, so I do not have the U-boot puts functions available.
I wrote the following function to convert a long to a HEX string:
-------------------
void print_long(unsigned long data) {
   char i;
   char 
hex_data[]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};

   for(i=0; i<8; i++) {
     while((U0LSR & (1<<5)) == 0); /* Wait for empty U0THR */
//    U0THR = hex_data[(0xDEADBEEF>>i*4)&0xF];
     U0THR = hex_data[(0xDEADBEEF>>4)&0xF];
   }
}
---------------
When I run it likes this I get 8 E's. Which is what I expect. When I run 
it with the commented-out line, I get back 8 0x0's. So it seems that the 
output is only correct when it is constant.
Does anyone have a clue on why that is?

Kind regards,

Remco Poelstra

             reply	other threads:[~2009-02-17 11:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-17 11:55 Remco Poelstra [this message]
2009-02-17 19:12 ` [U-Boot] Strange data behaviour Wolfgang Denk
2009-02-18  8:19   ` Remco Poelstra
2009-02-19  0:32     ` Kim Phillips

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=499AA5B8.7030805@duran-audio.com \
    --to=remco.poelstra@duran-audio.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.