ts-7000
[Top] [All Lists]

[ts-7000] SPI communication on TS-7200

To:
Subject: [ts-7000] SPI communication on TS-7200
From: Per Jonsson <>
Date: Fri, 28 Apr 2006 09:18:06 +0200
Hello,

We're using a TS-7200 in project course in Automatic Control at the
Deparment of Engineering at Linköping University. The project is to
implement a positioning and control system for a model aeroplane.

To interface with the radio-reciever in the aeroplane we have build a
circuit around a ATmega16 microcontroller to measure the pulsewidths the
reciever outputs to control the servos.

To talk to this ATmega16 we're are trying to use SPI. As the ATmega16
uses 5V logic, and the TS-7200 uses 3.5V, we use a Maxim 3390 as
converter chip to convert the voltage.
But we have some problems getting the SPI communication to work.
We're not getting the SPIFRAME signal to work.
According to the TS-7200's user manual you need to add a 10 Ohm resistor
at R1 to get the frame signal. Some guesswork from our part has made us
think that this is used as a pullup resistor, so we added it in the
header we use to connect to the DIO pin header, as we're not able to
solder surface mount components by ourselfs.
However it looks like we're not getting the FRAME signal to work
properly. Does anyone have any nice pointers on what to look at, as
we're running out of ideas on what to check.

For reference here's the code we're using for starting the SPI up on the
TS-7200:
-- Start Here --
/*!
 * @brief Gatekeeper setup
 *
 * @return On success 0, on failure 1
 */
int gatekeeper_init(struct gk_data *d)
{
    int fd;

    fd = open("/dev/mem", O_RDWR|O_SYNC);
    assert(fd != -1);

    d->chip_select_page = mmap(0, getpagesize(), PROT_READ|PROT_WRITE,
MAP_SHARE
D, fd, CHIP_SELECT_PAGE);
    assert(d->chip_select_page != MAP_FAILED);

    d->ssp_page = mmap(0, getpagesize(), PROT_READ|PROT_WRITE,
MAP_SHARED, fd, S
SP_PAGE);
    assert(d->ssp_page != MAP_FAILED);

    /*
      The EP9301 Users Manual says the following algorithm must
      be used to configure and enable the SPI bus
    */

    /* 1.) Set enable bit(SSE) in register SSPCR1 */
    POKE32( (unsigned long)(d->ssp_page + SSPCR1), 0x10 );

    /* 2.) Write other SSP config registers(SSPCR0 & SSPCPSR) */
    POKE32( (unsigned long)d->ssp_page, 0x07 ); // Motorola format 00
mode,
                                                // 8 bits of data
    POKE32( (unsigned long)(d->ssp_page + SSPCPSR), 0xFE);

    /* 3.) Clear the enable bit(SSE) in register SSPCR1 */
    POKE32( (unsigned long)(d->ssp_page + SSPCR1), 0x00);
    // Wait for lines to settle

    /* 4.) Set the enable bit(SSE) in register SSPCR1 */
    POKE32( (unsigned long)(d->ssp_page + SSPCR1), 0x10);

    return 0;
}
-- End Here --

POKE32 is the function available in Technologic Systems example for the
temperature sensor.


Thanks,


Per





Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/




<Prev in Thread] Current Thread [Next in Thread>
  • [ts-7000] SPI communication on TS-7200, Per Jonsson <=
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU