2009-09-21 12:43:14 ad1836 not found
Georg Greil (AUSTRIA)
Message: 80202
Hi,
My AD1836A is attached to SPORT0 and SPI_SSEL5 (i'm using bf537, uclinux 2009R1).
uclinux boot reports:
bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc00500, dma channel@7
Advanced Linux Sound Architecture Driver Version 1.0.18rc3.
dma_alloc_init: dma_page @ 0x01809000 - 512 pages at 0x01e00000
AD1836 Card is not attached
ALSA device list:
No soundcards found.
When I compile the driver as a module, it also says AD1836 is not attached while module loading.
I've tested the chip with a self-written (native) talkthrough, so it's proven the hardware is properly attached and working (without linux).
I've also tried to use 2M uncached DMA space but that did't change anything.
What can I do to get the Codec working with linux?
thanks
georg
TranslateQuoteReplyEditDelete
2009-09-21 15:21:47 Re: ad1836 not found
Robin Getz (UNITED STATES)
Message: 80204
Georg:
The most likley issue is the SPI chip select. Can you double check this?
-Robin
QuoteReplyEditDelete
2009-09-24 03:51:42 Re: ad1836 not found
Georg Greil (AUSTRIA)
Message: 80364
I am absolutly sure ad1836 is connected to SPI SSEL5 (TMR4, GPIO PF5). My test program also uses SSEL5 and it works.
In have chosen 5 in the configuration -I think this means SPI_SSEL5 (or does it not?).
I will try to compile uclinux with all 8 possible chip selects, to find out if any other works.
TranslateQuoteReplyEditDelete
2009-09-24 10:12:04 Re: ad1836 not found
Robin Getz (UNITED STATES)
Message: 80380
Georg:
I'm sure it is connected too - but that doesn't mean that the configuration is set up properly
Not only do you need to have the proper SPI configured - but you need to make sure there are no conflicts (a different driver trying to use the same pin). Are there any other drivers running?
-Robin
QuoteReplyEditDelete
2009-09-24 12:27:56 Re: ad1836 not found
Georg Greil (AUSTRIA)
Message: 80396
thanks for you reply,
I thought of that too, the only drivers i have activated are: MTD support, Network, UART0, SPI (with bus lock), Sound Card (AD1836)
Isn't there a boot-message from the kernel, that says that the pin is already in use? -this doesn't happen, so i guess it is not used already.
The pin could only be used by Timer4 or as GPIO PF5.
The GPIO Driver is deactivated and Timer4 may run, but i am not sure if it really uses the hardware-pin (I guess not).
Could any other driver use the GIPO function of PF5?
TranslateQuoteReplyEditDelete
2009-09-24 14:47:55 Re: ad1836 not found
Robin Getz (UNITED STATES)
Message: 80398
Georg:
On the 2009 kernel - it should print a message if there is a conflict. Do you see it wiggling with a scope? Do you see any SPI traffic?
-Robin
QuoteReplyEditDelete
2009-09-25 00:00:30 Re: ad1836 not found
Sonic Zhang (CHINA)
Message: 80410
In 2009R1 release, you should change the SPI channel setting in board configuration file instead of in kernel menu configure.
see file arch/blackfin/mach-bf537/board/stamp.c
QuoteReplyEditDelete
2009-09-25 07:53:56 Re: ad1836 not found
Georg Greil (AUSTRIA)
Message: 80449
I have finally managed to get the AD1836 running.
The scope showed that all signals where there and seemed to be correct, so I just
commented the following lines of /uClinux-dist/linux-2.6.x/sound/blackfin/ad1836.c out:
//ad1836_spi_read(chip->spi, (ADC_PEAK_1L << 12) | ADC_READ, &temp);
//if (temp == 0xffff) {
// printk(KERN_ERR "AD1836 Card is not attached\n");
// return -ENODEV;
//}
and now it works!
tested with tone - 1kHz is working
thanks for your help
georg greil
TranslateQuoteReplyEditDelete
2009-09-25 09:49:08 Re: ad1836 not found
Robin Getz (UNITED STATES)
Message: 80451
Georg:
Thanks for reporting -- I'm not sure that is safe (although it should be) - so we might want to remove it completely in our svn as well.
In reading the datasheet, it just says : Note that all control registers default to zero at power-up, but the ADC Peak Level Data Registers, should have the 4 LSBs tied to zero, so if things are working -- you should never get 0xFFFF. - no matter what. (Unless you have a pull up on MISO?)
-Robin
QuoteReplyEditDelete
2009-09-27 02:46:15 Re: ad1836 not found
Cliff Cai (CHINA)
Message: 80511
Hi Georg,
If possible,would you have a look at spi read,i.e. write some value to a register and read it back and compare them.
ADC_PEAK_1L would never be read out as 0xffff after reset,So I doubt that there is something wrong with MISO pin.
Cliff
QuoteReplyEditDelete
2009-09-29 16:10:50 Re: ad1836 not found
Georg Greil (AUSTRIA)
Message: 80651
hi,
i've a sd card as well on my board and there are 10k Ohm pull up resistors on MOSI and MISO.
i compiled uclinux with sd card driver and sound and its working, so the MISO bus works with the SD card (and I think in general too)
Maybe the driver in the AD1836 is too weak and so only 0xffff is read all the time from it. (but 10k pull up should't create that effect)
georg
TranslateQuoteReplyEditDelete
2009-09-29 23:39:27 Re: ad1836 not found
Sonic Zhang (CHINA)
Message: 80672
Could you please remove the pull up resistors and try the ad1836 test again?
QuoteReplyEditDelete
2009-09-30 03:05:07 Re: ad1836 not found
Georg Greil (AUSTRIA)
Message: 80679
I will try to unsolder the pull-up and then report the situation, but it will take me about two days until i can report.
TranslateQuoteReplyEditDelete
2009-10-02 03:22:08 Re: ad1836 not found
Georg Greil (AUSTRIA)
Message: 80797
hi!
I just unsoldered the pull-up resistor - now the Ad1836 test works great!
everything is working normal without the pull-up, but if I want to use my sd-card i nedd it.
I soldered it on the board again - test fails. - I will use the modified ad1836.c
greetings
georg greil