|
|
View previous topic :: View next topic |
Author |
Message |
bas
Joined: 30 Jan 2005 Posts: 4
|
PROBLEM SOLVED |
Posted: Tue Feb 01, 2005 9:59 pm |
|
|
Okay, we figured out the problem. It turns out the solution was buried in the Errata document of the 18f252:
Quote: | 10. Module: MSSP (SPI, Slave Mode)
In its current implementation, the SS (Slave
Select) control signal, generated by an external
master processor, may not be successfully recognized
by the PIC� microcontroller operating in
Slave Select mode (SSPM3:SSPM0 = 0100). In
particular, it has been observed that faster
transitions (those with shorter fall times) are more
likely to be missed than than slower transitions.
Work around
Insert a series resistor between the source of the
SS signal and the corresponding SS input line of
the microcontroller. The value of the resistor is
dependent on both the application system�s
characteristics and process variations between
microcontrollers. Experimentation and thorough
testing is encouraged.
This is a recommended solution. Others may exist. |
We used a 100 ohm resistor in series with the SCK line. It worked right off the bat... |
|
|
Guest
|
Re: Yes, but.... |
Posted: Thu Oct 06, 2005 9:10 am |
|
|
bas wrote: | We have a total of three 18F452's involved now--the main (master SPI), the audio (slave SPI), and the simulator on the breadboard (slave SPI). All three are running at 24 MHz.
The audio PIC's slave SPU port is set up as Jeff said
setup_spi (SPI_SLAVE | SPI_H_TO_L | SPI_XMIT_L_TO_H);
and it works with no problem.
But, in any matter, it seems to me that if the master and slave or both L_TO_H or H_TO_L, the problem will be the same. Doesn't one transition (say, H_TO_L) need to tell the slave to put the data bit to the output pin, and the next transition (in this case, L_TO_H) tell the master to latch that data bit? In other words, the slave puts on the falling edge and the master samples on the rising edge?
I guess I am unclear on the difference between SPI_ and SPI_XMIT in this case.
I don't think the PIC is resetting, Gary. MCLR is tied high with about a 20k resistor. We learned that after the 16C745 episode....
We're not using the RJ11 to connect the breadboard to the prototype board, but we're using connectors so we're sure contact is good, and the total wire distance is about 8" or so. |
|
|
|
Guest
|
|
Posted: Fri Dec 02, 2005 8:16 am |
|
|
object01 wrote: | Both PICs are running at 24MHz.
--
Jeff S. |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|