40x1 And Shiftin Shiftout

diepenpj

New Member
Hallo all,


try to use a ds1620, works fine on a basicstamp, but not sure how to use it on a 40x1. (don't want to blow up any port....)

on what port can i use shiftin and shifout for the 40x1? In my opinion the data port has tot be a input/output port, the clock and reset are output ports? So how to connect and where to define in my code?

is it advisable to use spiin spiout instead, and what port tot use then?
Many thanks!
 

Technical

Technical Support
Staff member
for spi you generally need 3 or 4 wires., depending on whether the chip has an enable pin.

The third party clock and sdi (and enable if it exists) pins connect to a PICAXE output, the third party sdo connects to a PICAXE input. You have to remmeber that output on the third party chip become an input on the PICAXE and vice versa. You can use any input or output pin.

spiin and spiout used fixed pins - see the PICAXE pinout diagram in the manual.
 

diepenpj

New Member
shiftin shiftout

still a question, the sdata pin in the shiftin and shiftout command is one pin on a ds1620. The ds1620 expects data to be sent to it, and gives a reading back on the same pin to the picaxe.

so i will send data (shiftout) to a ds 1620.
next i will read data from a ds1620 (shiftin)
this happens on the same datapin for a ds1620.

on what pin can i connect sdata for this purpose?
sclk has to be a output in my opinion, so no problem with that.

see command: SPIIN sclk,sdata,mode,(variable {/ bits} {, variable {/ bits}, ...})
SPIOUT sclk,sdata,mode,(data{/ bits}, {data{/ bits},...})

Sdata as said in my design the same pin so a In and out pin...
Sclk is the same pin, but is a output so use one of the output pins

Do I have to use a I/O pin like C1 to c7 for a 40X1 or must i use a special pin for shiftin shiftout. or are other pins suitable as well.

I'm afraid that a pin can blow up because data is sent and read on the same pin.
 

Technical

Technical Support
Staff member
You will need to connect both an input and an output pin to the DS1620 pin. You are correct in worrying about a clash betwen outputs, but a 1k resistor in series with the PICAXE output pin will resolve that.

ds1620 pin - 1k resistor - picaxe output
ds1620 pin - picaxe input
 
Top