Newbie -- Accessing Hardware Ports

Till Straumann strauman at SLAC.Stanford.EDU
Tue Feb 4 20:36:31 UTC 2003


A followup to my previous message.

I just had a quick look at your BSP. It seems that the on-board 
registers are attached to PCI_IO space starting at port 0.
Hence, you should be able to access your LEDs using the

outport_byte(0x860, (unsigned char)VALUE)

macro who does the necessary address translation (and IO barrier 
instruction [this is not strictly needed for your LED example]) for you.

-- Till

Don wrote:
> Okay, I have managed to get 'hello world' to work under both psim and 
> on a PPC2A using the ppcn_60x BSP.  Now I am trying to branch out and 
> exercise the board by flashing some LEDs.  Code snip looks something 
> like:
> 
> {
>     volatile unsigned8 *pLED_Control;
> 
>     pLED_Control = (unsigned8 *) 0x00000860;
> 
>     while(1)
>     {
>         *pLED_Control = 0x0F;
>         /**  wait loop  **/
>         *pLED_Control - 0x00;  /** LEDs should blink on & off  **/
>     }
> }
> 
> Unfortunately, nothing happens.  I have also tried reading some board 
> configuration locations (8-bit) and got back values that are no where 
> near what they should be.  
> 
> Now I have concluded the problem is one of the following, but have not 
> been able to find documentation to support or refute the position:
> 
> 1)  RTEMS does not allow direct manipulation of hardware ports via 
> pointers.  (But there has got to be a way around this as the COM port 
> works.)
> 
> 2)  That region of memory is being cached.  In which case I need to 
> figure out how to access the hardware registers to keep that region 
> from being cashed.
> 
> 3)  I have screwed up basic C code.
> 
> 4)  There is a board configuration problem.
> 
> Anybody willing to hazard a guess as to which is the most likely 
> problem?
> 
> Thanks!!
> 
> Don
> 
> 
> www.dynamic-controls-inc.com
> 






More information about the users mailing list