This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: spi_at91_set_npcs doesn't work


On Sat, Jul 15, 2006 at 08:05:35PM +0200, Jaws wrote:
> Hi all,
>    I noticed that the funciton spi_at91_set_npcs doesnt' work because use 
> the chip select as active high.
> a possible change could be
> 
> HAL_ARM_AT91_GPIO_PUT(spi_bus->cs_gpio[ctr], ((val & (1<<ctr))!=0) ? 0 : 1);
> 
> any one has experimented the same problem?

Hi Jaws

John Eigelaar might be able to help you here. 

John, are you using active high enable instead of active low? Do we
need some CDL to control active hi/low?

> I'm also working on my board and I noticed strange behaviour (under 
> investigation) related to the macro provided in 
> hal\arm\at91\var\current\var_io.h, it seems they don't take any effect on 
> the PIO controller.
> In my application I defined a function to inizialize the hardware platform 
> (hal_plf_hardware_init) that is called during the hal_hardware_init 
> funciton.
> If with the gdb look at the memory at the address 0xFFFEC000 (PIOA) at the 
> begin of the function and during the execution of the marco 
> HAL_ARM_AT91_PIO_CFG or HAL_ARM_AT91_GPIO_CFG_DIRECTION no changes appear 
> on the PIO_SR register. Why? What's wrong? It's the first time that I'm 
> using this macros I'm forgetting something very importnt?

There should be no magic needed. The macro's are a bit complex, but
the assembly language that results should be readable. Try
disassembling it and see if it does what you expect it to do. I tested
these macros on the AT91SAM7S with the LEDs and USB control pins. John
also tested them on the AT91SAM7X. However they could still be
broken....

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]