Main Site Documentation

SPI without ChipSelect


#1

I am trying to communication using Gadgeteer with a NXP PCF7991

In the technical data it talks about holding the SCLK high and during the SCLK high the MOSI switch high to low.

I’ve attached a picture from the manual, any ideas how one does that with .netmf?

Many thanks for any help


#2

Welcome to the forum!

I suggest you start with this document first:

https://www.ghielectronics.com/docs/14/spi

That should help a lot and if you still have questions don’t be shy to post here.


#3

Thanks for the reply

I’ve read that, bun I cannot see how you can hold the SCLK open and invert the MOSI.

I’ve got the SPI working but on the scope I cannot recreate what the pcf7991 document says or indeed what I can see what I hook the scope up to a pic controlled version of the circuit

“Any communication between the PCF7991AT and the
microcontroller begins with an initialization of the serial
interface before the desired command can be issued. The
interface initialization condition is a low-to-high transition
of the signal DIN while SCLK is high (see Fig.4).”

Is there any way of hold the SCLK open before it starts sending the clock?

When I look at the way the Pic chip is implement it, its holding the clock on the SCLK live for around 5 cycles and the MOSI goes low during the period and then the data is sent.

Maybe I’m being thick, but I just cannot see what I need to do.


#4

From what I can see, the PCF7991 is a very old IC. I can only find a 1 page PDF for it dated 1998. The NXP website doesn’t even find it in a search.

Most likely you are going to have to use BIT BANGING to talk to the device. This way you can control the SCK and MOSI lines in code as I am not sure you can do this from NETMF if you have already configured the SPI in hardware.

EDIT: I have found the HTRC110 which seems to be similar. Doesn’t look like to follows conventional SPI modes so bit banging may be your best solution.


#5

I’ve found this site:
http://www.acmesystems.it/spi

which in the first example seems to be what I’m trying to create.

I suppose if there is no “easy” way with .netmf then I’ll have to use a pic chip and get the .netmf to interface with that.

I bought one of these devices: http://uk.rs-online.com/web/p/rfid-modules/6172000/?searchTerm=RWD-QT&relevancy-data=636F3D3226696E3D4931384E4B6E6F776E41734D504E266C753D656E266D6D3D6D61746368616C6C7061727469616C26706D3D5E5B5C772D5C2E2F252C5D2B2426706F3D313326736E3D592673743D4D414E5F504152545F4E554D424552267573743D5257442D51542677633D424F544826
and its also using the pcf7991 but there isn’t a way to reconfigure the antenna on the unit.

lol nevermind more hard work then thanks for the input though


#6

Why not try bit banging it from NETMF first. If there is no speed issue, it should work.

Worth a try before you start adding a PIC to your design.


#7

I’ll give it a go then and update this thread eitherway. Save mes looking in the cupboard for a pic anyway