Quantcast

No SPI Output

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

No SPI Output

mmeisner
I have been struggling to get SPI working correctly.  So far I have modified the board file so SPI 1.0 is the touchscreen controller, and SPI 1.1 is my device, using the spidev driver.  I assume it's ok to use separate drivers on the same bus.

static struct spi_board_info overo_spi_board_info[] __initdata = {
        // SPI 1.0
        // (CONFIG_TOUCHSCREEN_ADS7846) || (CONFIG_TOUCHSCREEN_ADS7846_MODULE)
        {
                .modalias = "ads7846",
                .bus_num = 1,
                .chip_select = 0,
                .max_speed_hz = 100000, //100 kHz (125 kHz = max)
                .controller_data = &ads7846_mcspi_config,
                .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN),
                .platform_data = &ads7846_config,
        },

        // SPI 1.1
        // CONFIG_FPA_DRIVER
        {
                .modalias = "spidev",
                .max_speed_hz = 6000000, //6 MHz ( 48 MHz = max(OMAP3350) ) || ( 66 MHz = max (AT32UC3A1512) )
                .bus_num = 1,
                .chip_select = 1,
                .mode = SPI_MODE_1,
        },
};

static int __init overo_spi_init(void)
{
        overo_ads7846_init();
        spi_register_board_info(overo_spi_board_info,
                        ARRAY_SIZE(overo_spi_board_info));
        return 0;
}


I have also done the pinmux in the board file as follows:

static struct omap_board_mux board_mux[] __initdata = {
        OMAP3_MUX(MCSPI1_CLK,  OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
        OMAP3_MUX(MCSPI1_SIMO, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
        OMAP3_MUX(MCSPI1_SOMI, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
        OMAP3_MUX(MCSPI1_CS0,  OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
        OMAP3_MUX(MCSPI1_CS1,  OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
        { .reg_offset = OMAP_MUX_TERMINATOR },
};

The kernel builds and "/dev/spidev1.1" comes up after boot.  I'm using android so had to give my application root permission by using chmod via adb.  I can successfully open my device.  Write (half duplex) and ioctl (full duplex) calls come back without errors.  

The problem is nothing is happening with SPI 1.1.  The touchscreen works just fine, but the chip select (CS0) stays active low.   CS0 needs to go high and CS1 needs to go low, and then communicate with my device over the bus.  None of this is happening.

Anyone see something I may have missed?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No SPI Output

Kevyn-Alexandre Paré
Here if this could help

http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=57&Itemid=62


On 2011-11-29, at 7:30 PM, mmeisner wrote:

> I have been struggling to get SPI working correctly.  So far I have modified
> the board file so SPI 1.0 is the touchscreen controller, and SPI 1.1 is my
> device, using the spidev driver.  I assume it's ok to use separate drivers
> on the same bus.
>
> static struct spi_board_info overo_spi_board_info[] __initdata = {
> // SPI 1.0
> // (CONFIG_TOUCHSCREEN_ADS7846) || (CONFIG_TOUCHSCREEN_ADS7846_MODULE)
> {
> .modalias = "ads7846",
> .bus_num = 1,
> .chip_select = 0,
> .max_speed_hz = 100000, //100 kHz (125 kHz = max)
> .controller_data = &ads7846_mcspi_config,
> .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN),
> .platform_data = &ads7846_config,
> },
>
> // SPI 1.1
> // CONFIG_FPA_DRIVER
> {
> .modalias = "spidev",
> .max_speed_hz = 6000000, //6 MHz ( 48 MHz = max(OMAP3350) ) || ( 66 MHz
> = max (AT32UC3A1512) )
> .bus_num = 1,
> .chip_select = 1,
> .mode = SPI_MODE_1,
>        },
> };
>
> static int __init overo_spi_init(void)
> {
> overo_ads7846_init();
> spi_register_board_info(overo_spi_board_info,
> ARRAY_SIZE(overo_spi_board_info));
> return 0;
> }
>
>
> I have also done the pinmux in the board file as follows:
>
> static struct omap_board_mux board_mux[] __initdata = {
> OMAP3_MUX(MCSPI1_CLK,  OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
> OMAP3_MUX(MCSPI1_SIMO, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> OMAP3_MUX(MCSPI1_SOMI, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
> OMAP3_MUX(MCSPI1_CS0,  OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> OMAP3_MUX(MCSPI1_CS1,  OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
> { .reg_offset = OMAP_MUX_TERMINATOR },
> };
>
> The kernel builds and "/dev/spidev1.1" comes up after boot.  I'm using
> android so had to give my application root permission by using chmod via
> adb.  I can successfully open my device.  Write (half duplex) and ioctl
> (full duplex) calls come back without errors.  
>
> The problem is nothing is happening with SPI 1.1.  The touchscreen works
> just fine, but the chip select (CS0) stays active low.   CS0 needs to go
> high and CS1 needs to go low, and then communicate with my device over the
> bus.  None of this is happening.
>
> Anyone see something I may have missed?
>
> --
> View this message in context: http://gumstix.8.n6.nabble.com/No-SPI-Output-tp604174p604174.html
> Sent from the Gumstix mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure
> contains a definitive record of customers, application performance,
> security threats, fraudulent activity, and more. Splunk takes this
> data and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-novd2d
> _______________________________________________
> gumstix-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gumstix-users


------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of
discussion for anyone considering optimizing the pricing and packaging model
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No SPI Output

Jussi Nieminen-2
Hi,

The problem might also be in the OMAP SPI driver. Here's a thread about
problems that I encountered with it:
http://gumstix.8.n6.nabble.com/Several-problems-with-self-made-SPI-driver-td588406.html

So at least with kernels 2.6.36 and 2.6.39 the SPI didn't work
correctly, neither with my own driver nor with spidev. With 2.6.28-pm
SPI works with small transfers that don't use DMA. Longer ones get stuck
at one of the dma calls in the kernel SPI driver. I haven't had the
chance to try the newest kernels so I don't know what the situation is
with them.

Cheers,
Jussi


Kevyn-Alexandre Paré wrote:

> Here if this could help
>
> http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=57&Itemid=62
>
>
> On 2011-11-29, at 7:30 PM, mmeisner wrote:
>
>  
>> I have been struggling to get SPI working correctly.  So far I have modified
>> the board file so SPI 1.0 is the touchscreen controller, and SPI 1.1 is my
>> device, using the spidev driver.  I assume it's ok to use separate drivers
>> on the same bus.
>>
>> static struct spi_board_info overo_spi_board_info[] __initdata = {
>> // SPI 1.0
>> // (CONFIG_TOUCHSCREEN_ADS7846) || (CONFIG_TOUCHSCREEN_ADS7846_MODULE)
>> {
>> .modalias = "ads7846",
>> .bus_num = 1,
>> .chip_select = 0,
>> .max_speed_hz = 100000, //100 kHz (125 kHz = max)
>> .controller_data = &ads7846_mcspi_config,
>> .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN),
>> .platform_data = &ads7846_config,
>> },
>>
>> // SPI 1.1
>> // CONFIG_FPA_DRIVER
>> {
>> .modalias = "spidev",
>> .max_speed_hz = 6000000, //6 MHz ( 48 MHz = max(OMAP3350) ) || ( 66 MHz
>> = max (AT32UC3A1512) )
>> .bus_num = 1,
>> .chip_select = 1,
>> .mode = SPI_MODE_1,
>>        },
>> };
>>
>> static int __init overo_spi_init(void)
>> {
>> overo_ads7846_init();
>> spi_register_board_info(overo_spi_board_info,
>> ARRAY_SIZE(overo_spi_board_info));
>> return 0;
>> }
>>
>>
>> I have also done the pinmux in the board file as follows:
>>
>> static struct omap_board_mux board_mux[] __initdata = {
>> OMAP3_MUX(MCSPI1_CLK,  OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
>> OMAP3_MUX(MCSPI1_SIMO, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
>> OMAP3_MUX(MCSPI1_SOMI, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
>> OMAP3_MUX(MCSPI1_CS0,  OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
>> OMAP3_MUX(MCSPI1_CS1,  OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
>> { .reg_offset = OMAP_MUX_TERMINATOR },
>> };
>>
>> The kernel builds and "/dev/spidev1.1" comes up after boot.  I'm using
>> android so had to give my application root permission by using chmod via
>> adb.  I can successfully open my device.  Write (half duplex) and ioctl
>> (full duplex) calls come back without errors.  
>>
>> The problem is nothing is happening with SPI 1.1.  The touchscreen works
>> just fine, but the chip select (CS0) stays active low.   CS0 needs to go
>> high and CS1 needs to go low, and then communicate with my device over the
>> bus.  None of this is happening.
>>
>> Anyone see something I may have missed?
>>
>> --
>> View this message in context: http://gumstix.8.n6.nabble.com/No-SPI-Output-tp604174p604174.html
>> Sent from the Gumstix mailing list archive at Nabble.com.
>>
>> ------------------------------------------------------------------------------
>> All the data continuously generated in your IT infrastructure
>> contains a definitive record of customers, application performance,
>> security threats, fraudulent activity, and more. Splunk takes this
>> data and makes sense of it. IT sense. And common sense.
>> http://p.sf.net/sfu/splunk-novd2d
>> _______________________________________________
>> gumstix-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gumstix-users
>>    
>
>
> ------------------------------------------------------------------------------
> Cloud Services Checklist: Pricing and Packaging Optimization
> This white paper is intended to serve as a reference, checklist and point of
> discussion for anyone considering optimizing the pricing and packaging model
> of a cloud services business. Read Now!
> http://www.accelacomm.com/jaw/sfnl/114/51491232/
> _______________________________________________
> gumstix-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gumstix-users
>  


------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for
developers. It will provide a great way to learn Windows Azure and what it
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Loading...