Loading...
  Show Posts
Pages: 1 ... 441 442 [443] 444 445 ... 473
6631  Forum 2005-2010 (read only) / Interfacing / Re: Any advantage to running SPI interface faster? on: October 12, 2010, 07:34:16 am
Not hard to conceptualize really. Say the pulse that writes data into SPDR also clocks a FF that releases a counter and gates a clock through to a shift reg. The timer allows 8 clock pulses to the SR then resets the FF which stops the SR and counter.

Result, data gone out the MOSI pin.

_BV = Bit Value, a macro I think that will eveluate to 1000000 or bit 7 which is the location of the SPIF flag.

So the code is ANDing the SPSR reg with 1000000, if the result is 0 then the flag is not set and therefore the byte has not been fully transmitted.
6632  Forum 2005-2010 (read only) / Interfacing / Re: Any advantage to running SPI interface faster? on: October 11, 2010, 11:35:21 pm
Code:
 SPDR = _data;
load your outgoing data into the SPI shift reg's data register

 
Code:
while (!(SPSR & _BV(SPIF))) ;
wait for the data to be transmitted on MOSI (and also received on MISO)

Code:
 return SPDR;
return the received data from the data register

6633  Forum 2005-2010 (read only) / Interfacing / Re: Arduino Reset Pin - Is A Resistor Needed? on: October 11, 2010, 06:19:43 pm
Quote
It physically won't fit.
Can you use an SMD resistor? That can go just about anywhere.
6634  Forum 2005-2010 (read only) / Interfacing / Re: Chip select with shift register and dac on: October 11, 2010, 08:18:26 pm
AFAIK it's up to the program to toggle SS, there's no other practical way to do it because the SPI hardware can't know how many bytes you want to send.

If the SPI library toggles for each byte then you can't use it, or you can use it but implement you own SS and leave the normal one (pin 10?) unconnected.
6635  Forum 2005-2010 (read only) / Interfacing / Re: Chip select with shift register and dac on: October 11, 2010, 10:42:22 am
Quote
But it seems like the dac only needs two pins to communicate via SPI... because it doesn't need to send data back to the Arduino.  So pin 12 on the Arduino doesn't need to be connected to anything.
True, you don't have to use MISO.

Quote
I can't tell if it's needed for the smaller single dac chip I'm using.
The single version still has an LDAC pin, so yes it would be needed.

Unfortunately LDAC is an active LOW latch enable so you can't just hook it up to SS on the SPI interface as SS will go low for the entire frame. You can with the SR because it's a rising-edge clock, but not the DAC.

You need to organise a low pulse (min 100nS) on the rising edge of SS and feed that to LDAC.
6636  Forum 2005-2010 (read only) / Interfacing / Re: Chip select with shift register and dac on: October 10, 2010, 05:20:00 pm
1) So do that
2) The SR can shift at about 25MHz, I'm pretty sure it will keep up  smiley
3) Only you can decide this because you know what else the code has to do, but if you're using the SPI hardware there's almost 0 overhead in shifting bits out at 4MHz so it shouldn't affect your code much.

Anyway it's worth a try.

Rob

EDIT: Looks like the SR can shift at about 12.5MHz.
6637  Forum 2005-2010 (read only) / Interfacing / Re: Chip select with shift register and dac on: October 10, 2010, 09:44:23 am
What about daisy-chaining the two chips.

ARD -> serin SR serout -> sdi DAC

clock and latch are in parallel and a single data out pin so only 3 pins needed.

Send 16 bits every time. When writing to the SR send the existing value to the DAC, and vice versa.
6638  Forum 2005-2010 (read only) / Interfacing / Re: Chip select with shift register and dac on: October 10, 2010, 08:40:12 am
Pulling SCLR low will simply cause 0s to be latched to the outputs when RCK goes high.

Unfortunately I don't think it's possible to do this without a small amount of logic, say to gate the SRs clock signal.

6639  Forum 2005-2010 (read only) / Interfacing / Re: reading accelerometers on: October 11, 2010, 12:27:22 am
If you put it in the buffer surely you can get it out. So is the question really how to upload the data to a PC for graphing? Or are you using a GLCD? What frequency does this need to occur at? Against what time base, time of day or just relative to the last reading? etc etc.
6640  Forum 2005-2010 (read only) / Interfacing / Re: ribbon to ribbon connector? on: October 08, 2010, 09:16:43 am
Solder normal headers back-to-back.

If necessary split the ribbon cable and use seperate IDC sockets to handle the odd header spacing.
6641  Forum 2005-2010 (read only) / Interfacing / Re: can we drive max7219 and 74hc595 from one mega328? on: October 09, 2010, 07:16:31 pm
The 7219 has an SPI-style interface that uses four pins so you can use both.
6642  Forum 2005-2010 (read only) / Interfacing / Re: Source or sink - which? on: October 10, 2010, 08:32:28 am
Maybe many examples are done this way to ease any beginner confustion, HIGH = ON possibly makes more sense for someone just starting out.
6643  Forum 2005-2010 (read only) / Interfacing / Re: Arduino Ethernet Shield Pins on: October 06, 2010, 06:41:10 am
I made a start on such a list a couple of weeks ago, see this thread

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1285946134/3#3

or for direct links to the table

http://www.robgray.com/temp/Arduino-shield-pins-used.xls

If you don't trust an XLS file here's a screen shot

http://www.robgray.com/temp/Arduino-shield-pins-used.png

The table details many shiilds and the pins they use.

I spent hours looking at schematics (where available) and also used info from Mowcius' site and the Arduino site, but don't treat the list as gospel, many schematics are confusing plus I got a bit cross-eyed after a while. Also some schematics were in a version of Eagle I coudn't read.

Hopefully one day we can build on this to provide a comprehensive resource.

Rob



6644  Forum 2005-2010 (read only) / Interfacing / Re: Arduino in pressurized environment on: October 02, 2010, 09:02:36 am
200 bar! Are you sending an Arduino to the bottom of the Puerto Rico Trench?

I would think that at least some components would implode, for example electro caps.

Why does everything have to be under pressure, are you not allowed to pierce the vessel or something?
6645  Forum 2005-2010 (read only) / Interfacing / Re: Confused about shields on: October 01, 2010, 07:08:51 pm
There's a thread here about the different pins used by shields

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1284962949/5#5

with a table (as yet unverified) showing the pins used by a lot of shields.
Pages: 1 ... 441 442 [443] 444 445 ... 473