CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

spi MISO - no exchange of data

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
fkl



Joined: 20 Nov 2010
Posts: 44

View user's profile Send private message

spi MISO - no exchange of data
PostPosted: Fri Sep 27, 2013 11:03 am     Reply with quote

Please help.
chip pic24fj064gb106

Code:

#pin_select SCK1OUT=PIN_B1
#pin_select SDI=PIN_B0
#pin_select SDO=PIN_B2
#use spi (MASTER, SPI1, MODE=0, BITS=8, ENABLE=PIN9, STREAM=SPI_PORT1_0, FORCE_HW)

...

main()
{
    ...
    spi_init(SPI_PORT1_0, 1000000);
    ...
    spi_write(0x05);
    data_in=spi_read(0);// data_in<=0xFF
    ...
}


On MOSI - is exchanged of data.
MISO - no exchange of data (line always high).
Checked using a logic analyzer.


Where is the error?
Ttelmah



Joined: 11 Mar 2010
Posts: 19343

View user's profile Send private message

PostPosted: Fri Sep 27, 2013 12:42 pm     Reply with quote

Er. MOSI, is driven by the PIC.
MISO, has to be driven by the device at the other end of the connection.

What is driving it?.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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