DSPRelated.com
Forums

SPI between DSP56F801 and DSP56F805

Started by grdeathsa October 23, 2002
I set up two evalution boards of motorola one with DSP801 and the
other DSP805 witch is the master the other the slave.
But the two boards do not what to communicate seems that the data is
going out correctly but the 801 seems to start putting the data in at
the wrong clock cycle. I checked the board rate and the two match.

I am developing in radegast v 2.0.

Can any body please send me some hints what could be wrong or example
code.



For this type of question, you should include code fragments or complete files
from your program. Without them, we cannot see what is wrong in your program.

For information about initializing the SPI, please see my message "RE:
[motoroladsp] 56F807's SPI can't access X5043" that was posted to this
discussion group on September 5, 2002, at about 8:20am. Please note that this
message shows the Master mode only, but the Slave mode will be similar except
the SPI Master Bit (SPMSTR, bit 4) in the SPI Status and Control Register
(SPSCR) will be 0. Please see Section 13.9.1 "SPI Status and Control Register
(SPSCR)" in the DSP56F80x User's Manual.

You also need to make sure that the Clock Polarity Bit (CPOL, bit 3) and the
Clock Phase Bit (CPHA, bit 2) in the SPI Status and Control Register (SPSCR) are
set the same in both of your programs. Also, you should read Section 13.8.2
"Transmission Formats" in the DSP56F80x User's Manual. From the description of
your problem, it sounds like the CPHA bit is the wrong value in the Slave
(DSP801) system.

I hope this helps, please send additional information if you are still having a
problem.

Regards,

Art Johnson
Senior Systems Analyst
PMC Prime Mover Controls Inc.
3600 Gilmore Way
Burnaby, B.C., Canada
V5G 4R8
Phone: 604 433-4644
FAX: 604 433-5570
Email:
http://www.pmc-controls.com
-----Original Message-----
From: grdeathsa [mailto:]
Sent: Wednesday, October 23, 2002 12:02 AM
To:
Subject: [motoroladsp] SPI between DSP56F801 and DSP56F805 I set up two evalution boards of motorola one with DSP801 and the
other DSP805 witch is the master the other the slave.
But the two boards do not what to communicate seems that the data is
going out correctly but the 801 seems to start putting the data in at
the wrong clock cycle. I checked the board rate and the two match.

I am developing in radegast v 2.0.

Can any body please send me some hints what could be wrong or example
code.
_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this
message will receive your answer. You need to do a "reply all" if you want your
answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:

To Post:

To Leave:

Archives: http://www.yahoogroups.com/group/motoroladsp

More Groups: http://www.dsprelated.com/groups.php3 ">http://docs.yahoo.com/info/terms/


I agree with what Art has posted in his reply. Also, you will need to
check errata for both chips. Earlier versions of the silicon had SPI
errata that was fixed in the production parts.

Also, radegast that you are using is not supported product by Motorola
for DSP56800/800E parts, and it has very limited user base. So I would
be very surprised to see anyone in this newsgroup with any knowledge of
it (with exception of few internal Motorola developers). If you have
radegast question, you should go directly to the person who gave you the
software.

Since you are not using SDK, I would recommend for you at least look at
the SDK for DSP56800/800E SPI driver code. Implementation of this driver
compensated for earlier HW errata, so that if you use SDK SPI driver,
you would not notice existing HW problems.

Sincerely,

Leonard N. Elevich
Motorola DSPO

-----Original Message-----
From: grdeathsa [mailto:]
Sent: Wednesday, October 23, 2002 12:02 AM
To:
Subject: [motoroladsp] SPI between DSP56F801 and DSP56F805

I set up two evalution boards of motorola one with DSP801 and the
other DSP805 witch is the master the other the slave.
But the two boards do not what to communicate seems that the data is
going out correctly but the 801 seems to start putting the data in at
the wrong clock cycle. I checked the board rate and the two match.

I am developing in radegast v 2.0.

Can any body please send me some hints what could be wrong or example
code.
_____________________________________
Note: If you do a simple "reply" with your email client, only the author
of this message will receive your answer. You need to do a "reply all"
if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:

To Post:

To Leave:

Archives: http://www.yahoogroups.com/group/motoroladsp

More Groups: http://www.dsprelated.com/groups.php3 ">http://docs.yahoo.com/info/terms/


You may want to check the errata for the chips. I believe there is still an
errata for slave mode. Plus, if you have an earlier rev part, there were
some significant problems with the SPI.

-----Original Message-----
From: grdeathsa [mailto:]
Sent: Wednesday, October 23, 2002 12:02 AM
To:
Subject: [motoroladsp] SPI between DSP56F801 and DSP56F805 I set up two evalution boards of motorola one with DSP801 and the
other DSP805 witch is the master the other the slave.
But the two boards do not what to communicate seems that the data is
going out correctly but the 801 seems to start putting the data in at
the wrong clock cycle. I checked the board rate and the two match.

I am developing in radegast v 2.0.

Can any body please send me some hints what could be wrong or example
code.
_____________________________________
Note: If you do a simple "reply" with your email client, only the author of
this message will receive your answer. You need to do a "reply all" if you
want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:

To Post:

To Leave:

Archives: http://www.yahoogroups.com/group/motoroladsp

More Groups: http://www.dsprelated.com/groups.php3 ">http://docs.yahoo.com/info/terms/


Please look at the example code for the SPI Master application I have attached.
This is from the DSP56F805 SDK directory at:
...\src\dsp56805evm\nos\applications\spi

Please note that "..." is the directory where you installed the SDK
(C:\Development\DSP568xx\Moto_SDK in our systems here).

The parameter "SpiParams.bSetAsMaster" must be set to 1 for the Master, and it
must be set to 0 for the Slave. The SPI ports of the 2 systems must be
connected according to Figure 13-3 "Full-Duplex Master-Slave Connections" in the
DSP56F80x User's Manual.

You should also add the following ioctl calls in both programs (please note that
the File Descriptor returned by the open() call is named "SerialMaster" in the
Master program, and it is named "SerialSlave" in the Slave program):
In the Master:
ioctl(SerialMaster,SPI_MODE_MASTER,NULL);
ioctl(SerialMaster,SPI_DATA_SHIFT_MSB_FIRST,NULL);
ioctl(SerialMaster,SPI_MODE_FAULT_DISABLE,NULL);
ioctl(SerialMaster,SPI_CLK_POL_FALLING_EDGE,NULL);
ioctl(SerialMaster,SPI_CLOCK_PHASE_SET,NULL);
In the Slave:
ioctl(SerialSlave,SPI_MODE_SLAVE,NULL);
ioctl(SerialSlave,SPI_DATA_SHIFT_MSB_FIRST,NULL);
ioctl(SerialSlave,SPI_MODE_FAULT_DISABLE,NULL);
ioctl(SerialSlave,SPI_CLK_POL_FALLING_EDGE,NULL);
ioctl(SerialSlave,SPI_CLOCK_PHASE_SET,NULL);

There is documentation for the SPI Driver in the on-line manual, start it as
follows:
Start
Programs
Motorola
Embedded SDK 2.5
Help and Documentation

In "Contents", go to:
Motorola Embedded SDK
Software Solutions
Targeting DSP568xx Platforms
DSP56826/827 Platform
5 On-Chip Drivers
5.1 SPI Driver
5.1.4 SPI Device Independent I/O API Specifications
5.1.4.5 ioctl

Also please look at Example 5-2 "SPI Driver Usage" on the second page of the
ioctl description.

This information should get your SPI ports communicating with each other.

Regards,

Art Johnson
Senior Systems Analyst
PMC Prime Mover Controls Inc.
3600 Gilmore Way
Burnaby, B.C., Canada
V5G 4R8
Phone: 604 433-4644
FAX: 604 433-5570
Email:
http://www.pmc-controls.com

-----Original Message-----
From: Frikkie Marais [mailto:]
Sent: Wednesday, October 23, 2002 11:02 PM
To: Art Johnson
Subject: RE: [motoroladsp] SPI between DSP56F801 and DSP56F805 Hi Art

Sorry about that I made sure this time that the file's are there now.
I will have a look also to do this in SDK.
Only problem is SDK has to many files that need to be viewed to do a little
example or
a big one.

Frikkie

-----Original Message-----
From: Art Johnson [mailto:]
Sent: 23 October 2002 16:40
To: Frikkie Marais
Subject: RE: [motoroladsp] SPI between DSP56F801 and DSP56F805 Hi Frikkie

There was not any attachment with your message, please send me the file(s)
you would like me to look at.
Regards,
Art -----Original Message-----
From: Frikkie Marais [mailto:]
Sent: Wednesday, October 23, 2002 6:21 AM
To: Art Johnson
Subject: RE: [motoroladsp] SPI between DSP56F801 and DSP56F805 Hi Art

Here is some of the code that I have writen very basic.
Hope that you realy can help me.
Thanks. -----Original Message-----
From: Art Johnson [mailto:]
Sent: 23 October 2002 15:04
To: grdeathsa;
Subject: RE: [motoroladsp] SPI between DSP56F801 and DSP56F805 For this type of question, you should include code fragments or complete
files from your program. Without them, we cannot see what is wrong in your
program.

For information about initializing the SPI, please see my message "RE:
[motoroladsp] 56F807's SPI can't access X5043" that was posted to this
discussion group on September 5, 2002, at about 8:20am. Please note that
this message shows the Master mode only, but the Slave mode will be similar
except the SPI Master Bit (SPMSTR, bit 4) in the SPI Status and Control
Register (SPSCR) will be 0. Please see Section 13.9.1 "SPI Status and
Control Register (SPSCR)" in the DSP56F80x User's Manual.

You also need to make sure that the Clock Polarity Bit (CPOL, bit 3) and the
Clock Phase Bit (CPHA, bit 2) in the SPI Status and Control Register (SPSCR)
are set the same in both of your programs. Also, you should read Section
13.8.2 "Transmission Formats" in the DSP56F80x User's Manual. From the
description of your problem, it sounds like the CPHA bit is the wrong value
in the Slave (DSP801) system.

I hope this helps, please send additional information if you are still
having a problem.

Regards,

Art Johnson
Senior Systems Analyst
PMC Prime Mover Controls Inc.
3600 Gilmore Way
Burnaby, B.C., Canada
V5G 4R8
Phone: 604 433-4644
FAX: 604 433-5570
Email:
http://www.pmc-controls.com
-----Original Message-----
From: grdeathsa [mailto:]
Sent: Wednesday, October 23, 2002 12:02 AM
To:
Subject: [motoroladsp] SPI between DSP56F801 and DSP56F805 I set up two evalution boards of motorola one with DSP801 and the
other DSP805 witch is the master the other the slave.
But the two boards do not what to communicate seems that the data is
going out correctly but the 801 seems to start putting the data in at
the wrong clock cycle. I checked the board rate and the two match.

I am developing in radegast v 2.0.

Can any body please send me some hints what could be wrong or example
code.
_____________________________________
Note: If you do a simple "reply" with your email client, only the author of
this message will receive your answer. You need to do a "reply all" if you
want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:

To Post:

To Leave:

Archives: http://www.yahoogroups.com/group/motoroladsp

More Groups: http://www.dsprelated.com/groups.php3 ">http://docs.yahoo.com/info/terms/


Attachment (not stored)
spiapp.zip
Type: application/x-zip-compressed


Thanks Art for all your help but I found out that the buardrate on the 801
was out the value that they got was to low so I inserted the value manualy.
Frikkie.

-----Original Message-----
From: Art Johnson [mailto:]
Sent: 25 October 2002 14:36
To: Frikkie Marais;
Subject: RE: [motoroladsp] SPI between DSP56F801 and DSP56F805 Please look at the example code for the SPI Master application I have
attached. This is from the DSP56F805 SDK directory at:
...\src\dsp56805evm\nos\applications\spi

Please note that "..." is the directory where you installed the SDK
(C:\Development\DSP568xx\Moto_SDK in our systems here).

The parameter "SpiParams.bSetAsMaster" must be set to 1 for the Master, and
it must be set to 0 for the Slave. The SPI ports of the 2 systems must be
connected according to Figure 13-3 "Full-Duplex Master-Slave Connections" in
the DSP56F80x User's Manual.

You should also add the following ioctl calls in both programs (please note
that the File Descriptor returned by the open() call is named "SerialMaster"
in the Master program, and it is named "SerialSlave" in the Slave program):
In the Master:
ioctl(SerialMaster,SPI_MODE_MASTER,NULL);
ioctl(SerialMaster,SPI_DATA_SHIFT_MSB_FIRST,NULL);
ioctl(SerialMaster,SPI_MODE_FAULT_DISABLE,NULL);
ioctl(SerialMaster,SPI_CLK_POL_FALLING_EDGE,NULL);
ioctl(SerialMaster,SPI_CLOCK_PHASE_SET,NULL);
In the Slave:
ioctl(SerialSlave,SPI_MODE_SLAVE,NULL);
ioctl(SerialSlave,SPI_DATA_SHIFT_MSB_FIRST,NULL);
ioctl(SerialSlave,SPI_MODE_FAULT_DISABLE,NULL);
ioctl(SerialSlave,SPI_CLK_POL_FALLING_EDGE,NULL);
ioctl(SerialSlave,SPI_CLOCK_PHASE_SET,NULL);

There is documentation for the SPI Driver in the on-line manual, start it as
follows:
Start
Programs
Motorola
Embedded SDK 2.5
Help and Documentation

In "Contents", go to:
Motorola Embedded SDK
Software Solutions
Targeting DSP568xx Platforms
DSP56826/827 Platform
5 On-Chip Drivers
5.1 SPI Driver
5.1.4 SPI Device Independent I/O API Specifications
5.1.4.5 ioctl

Also please look at Example 5-2 "SPI Driver Usage" on the second page of the
ioctl description.

This information should get your SPI ports communicating with each other.

Regards,

Art Johnson
Senior Systems Analyst
PMC Prime Mover Controls Inc.
3600 Gilmore Way
Burnaby, B.C., Canada
V5G 4R8
Phone: 604 433-4644
FAX: 604 433-5570
Email:
http://www.pmc-controls.com

-----Original Message-----
From: Frikkie Marais [mailto:]
Sent: Wednesday, October 23, 2002 11:02 PM
To: Art Johnson
Subject: RE: [motoroladsp] SPI between DSP56F801 and DSP56F805 Hi Art

Sorry about that I made sure this time that the file's are there now.
I will have a look also to do this in SDK.
Only problem is SDK has to many files that need to be viewed to do a little
example or
a big one.

Frikkie

-----Original Message-----
From: Art Johnson [mailto:]
Sent: 23 October 2002 16:40
To: Frikkie Marais
Subject: RE: [motoroladsp] SPI between DSP56F801 and DSP56F805 Hi Frikkie

There was not any attachment with your message, please send me the file(s)
you would like me to look at.
Regards,
Art -----Original Message-----
From: Frikkie Marais [mailto:]
Sent: Wednesday, October 23, 2002 6:21 AM
To: Art Johnson
Subject: RE: [motoroladsp] SPI between DSP56F801 and DSP56F805 Hi Art

Here is some of the code that I have writen very basic.
Hope that you realy can help me.
Thanks. -----Original Message-----
From: Art Johnson [mailto:]
Sent: 23 October 2002 15:04
To: grdeathsa;
Subject: RE: [motoroladsp] SPI between DSP56F801 and DSP56F805 For this type of question, you should include code fragments or complete
files from your program. Without them, we cannot see what is wrong in your
program.

For information about initializing the SPI, please see my message "RE:
[motoroladsp] 56F807's SPI can't access X5043" that was posted to this
discussion group on September 5, 2002, at about 8:20am. Please note that
this message shows the Master mode only, but the Slave mode will be similar
except the SPI Master Bit (SPMSTR, bit 4) in the SPI Status and Control
Register (SPSCR) will be 0. Please see Section 13.9.1 "SPI Status and
Control Register (SPSCR)" in the DSP56F80x User's Manual.

You also need to make sure that the Clock Polarity Bit (CPOL, bit 3) and the
Clock Phase Bit (CPHA, bit 2) in the SPI Status and Control Register (SPSCR)
are set the same in both of your programs. Also, you should read Section
13.8.2 "Transmission Formats" in the DSP56F80x User's Manual. From the
description of your problem, it sounds like the CPHA bit is the wrong value
in the Slave (DSP801) system.

I hope this helps, please send additional information if you are still
having a problem.

Regards,

Art Johnson
Senior Systems Analyst
PMC Prime Mover Controls Inc.
3600 Gilmore Way
Burnaby, B.C., Canada
V5G 4R8
Phone: 604 433-4644
FAX: 604 433-5570
Email:
http://www.pmc-controls.com
-----Original Message-----
From: grdeathsa [mailto:]
Sent: Wednesday, October 23, 2002 12:02 AM
To:
Subject: [motoroladsp] SPI between DSP56F801 and DSP56F805 I set up two evalution boards of motorola one with DSP801 and the
other DSP805 witch is the master the other the slave.
But the two boards do not what to communicate seems that the data is
going out correctly but the 801 seems to start putting the data in at
the wrong clock cycle. I checked the board rate and the two match.

I am developing in radegast v 2.0.

Can any body please send me some hints what could be wrong or example
code.
_____________________________________
Note: If you do a simple "reply" with your email client, only the author of
this message will receive your answer. You need to do a "reply all" if you
want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:

To Post:

To Leave:

Archives: http://www.yahoogroups.com/group/motoroladsp

More Groups: http://www.dsprelated.com/groups.php3 ">http://docs.yahoo.com/info/terms/