Hi,
All I can say is that the PIC and PBP supports SPI communcation, either by using SHIFTIN/SHIFTOUT or using the MSSP peripheral module built into most devices. That gives you the interface between the PIC (master in this case) and the TRH031M (slave in this case). I see no reason for it not to work, however there are occasions where SHIFTIN/SHIFTOUT is NOT an option because the the slave devices is shifitng in and out data at the same time, in those cases you must use the MSSP module because the SHIFTIN/SHIFTOUT either shift data in OR shifts data out they can't do both simultanously.
But, the TRH031M is a complicated device, it's not as simple as just "send some data" to it. It needs setting up, it needs commands sent to it, it needs data sent to it, it needs new commands sent to it, it needs to be polled for status and so on. You absolutely must read and understand the datasheet or you won't be able to make this work. Again, I've never used the device so *I* don't know how it works, I've just very briefly browsed thru the datasheet.
I strongly suggest you put your PIC, a 74*595 (serial in, parallel out) and a 74*165 (parallel in, serial out) shiftregisters, a couple of LEDs and a couple of switches on a breadboard and get used to communicating with those. Use SHIFTOUT to write data to the 74*595 and SHIFTIN to read data from the 74*165. When you have that working and understand how it works, try the MSSP module instead of SHIFTIN/SHIFTOUT. With that you'll be able to write one byte to the 74*595 and read one byte from the 74*165 all in one go - which MIGHT be what's needed for the TRH031M - I'm not sure.
THEN get back to the TRH031M.
/Henrik.




Bookmarks