Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with getting data from Slave SPI to UART C18

Status
Not open for further replies.

eng.hasan.power

Member level 1
Joined
Mar 30, 2006
Messages
39
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,597
ciao Tutti,

im trying to get the string from the SPI,
i have 97J60 Ethernet Controller, working as a SPI Slave,

now im trying to get the string, from the Master, then send it to the UART, for testing,

here is my Code,
int Receive(void)
{
char tempSPI1[1]; // This is our received byte.
int tempSPI;
OpenSPI1(SLV_SSOFF, MODE_00, SMPEND); //hasan
getsSPI1(tempSPI1, 1); // Read buffer
DelayMs(50);
putsUART(tempSPI1);
DelayMs(50);
CloseSPI1(); // Disable the MSSP
putrsUART(" received somthing ");
CloseSPI1(); // Disable the MSSP
}

the problem is,
when i send 0xEE i receive string "f" ,,,which represent 0x66 not 0xEE
when i send 0x00 i receive nothing,,,,when i receive 0x0A i receive nothing too,,,
when i send 0xF0 i receive p ,, which is false too,,,,,,

i dont know where is the problem,
im sure about the master, i can see it clearly with the Oscilloscope,

thanks in Advance, Regards
Hasan
 

Slave SPI, UART C18

well how are initalizing your usart?
 

Re: Slave SPI, UART C18

thanks for the reply,

its the same as the TCP/IP version 4,,,,,,,,, i didnt change anything of the initialization,,,,,,
the only changing in the using of the SPI libraries, i added the openSPI, closeSPI....etc, to the program,

and the UART working fine, i think,,,because it out A, and B ,,, as testing,,,
 

Slave SPI, UART C18

so usart is ok...
master is ok..
(which controller are you using?)
slave spi is working? how have you tested it?
could you show all your init procedures (both master and slave SPI and USART?)

Added after 3 minutes:

by the way... which compiler are you using?
 

Re: Slave SPI, UART C18

the Master is a DSP,

the Ethernet -slave SPI- , i dont know, if it working or not, but the UART, working fine in the other parts of the program, and its the same as TCP/IP version4, as i mentioned before,,,,

and the initialization in
OpenSPI1(SLV_SSOFF, MODE_00, SMPEND); i think,,,,

i dont know if there is other initialization needed or not,

for the SPI-Master the DSP part, its TI C28xx,
and i can see the SPI signals with Oscillioscope, but not the two channels at the same time,
for example,
the Master output data, working fine on channel 1
the Master Clock is working fine on the channel 1

but when i use the two channels, only one of the signal good, and the other bad,,,

i dont know if the problem, in my code, or just Oscilloscope problem, :(


Regards
Hasan
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top