On Sun, Feb 27, 2011 at 10:19:09PM +0400, Elvis Dowson wrote:
> Hi,
> I'm working on a custom beagleboard platform based on the OMAP3503
> processor.
>
> I have a Freescale Zigbee radio module connected to the SPI bus, and it is to
> be used for flashing the radio module's firmware image.
>
> I am using a program derived from the spidev_test.c file in the
> android-2.6.32-kernel/Documentation/spi folder.
>
> The android linux kernel is a standard rowboat linux kernel based, which
> includes TI's platform support for OMAP35x from TI's arago OMAP PSP project.
>
> The problem that I am having is that the first bit of every SPI byte transfer
> received from the slave zigbee module is a zero.
>
> For example, 0xEA when transmitted, comes out as 0x6A.
>
> Here is an example message transmit and receive sequence. The zigbee module
> sends a zero for the first byte transferred, and then echoes the first byte
> sent, as a response in a subsequent transfer, as an acknowledgement.
>
> Number of elements read from the firmware update file into the transmit
> buffer = 16
>
> Displaying the contents of the transmit buffer array
>
> 55 10 00 EA 76 10 00 EA 7D 10 00 EA 84 10 00 EA
>
> Displaying the contents of the receive buffer array
>
> 00 00 55 10 00 6A 76 10 00 6A 7D 10 00 6A 04 10
>
> Number of bytes received = 16 bytes
>
> Similarily, 0x84 changes to 0x04.
>
> Looking at the binary representation,
>
> 0xEA = 1110 1010
> 0x6A = 0110 1010
>
> 0x84 = 1000 0100
> 0x04 = 0000 0100
>
> >From the above pattern, it looks like I'm losing the most significant bit
> >for every 8-bit (1 byte) transfer.
>
> Looking at the data pattern, the ones that come back correctly are the ones
> that don't need the 8th bit set to represent its value, e.g. 0x50, 0x10,
> 0x00, etc.
>
> What could be causing the first bit stuck at 0 ?
It could easily be a mismatch between the spi master and the spi slave
on the transfer mode. Look for SPI_MODE_{0,1,2,3}, and compare it
with what the zigbee module expects.
g.
>
>
> Elvis Dowson
>
> ------------------------------------------------------------------------------
> Free Software Download: Index, Search & Analyze Logs and other IT data in
> Real-Time with Splunk. Collect, index and harness all the fast moving IT data
> generated by your applications, servers and devices whether physical, virtual
> or in the cloud. Deliver compliance at lower cost and gain new business
> insights. http://p.sf.net/sfu/splunk-dev2dev
> _______________________________________________
> spi-devel-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/spi-devel-general
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
spi-devel-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spi-devel-general