Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Interfacing / Re: Arduino  I2C/TWI <----> Attiny2313 on: July 31, 2010, 10:12:08 am
Hi Richard,

I'm using an Arduino ánd a couple of attiny2313 ics.

Kind regards.
2  Forum 2005-2010 (read only) / Interfacing / Arduino  I2C/TWI <----> Attiny2313 on: July 31, 2010, 02:05:07 am
Dear reader,

For a project we need to read out the serial data from ~5 RFID readers.  Each RFID reader will get it's own casing with some nice lights in it.  We've tried to use attiny2313 as a I2C slave (or as it''s called TWI) and one Arduino as the master.  When the Arduino sends data to a slave, the data is received correctly. I'm using USE_TWI_Slave.h/c filles I got from Atmel.

Now we want the attiny2313 slaves to send data back to the master and this is where the problems start. The master and slave seem to "hang" or wait for each other. I'm not totally sure what's happening but as I read it can be due to speed/timing. I read the slave can hold the clock line low to tell the master to delay the transfer. This would make some sense, but I've no scope so I cannot check this.

I was hoping other people maybe had a same situation and see what's the problem.

Kind regards
Roxlu
3  Forum 2005-2010 (read only) / Interfacing / IR light switch on: May 14, 2009, 02:13:39 pm
Hi there,

I'm working on a project where I need to check if someone throws something into a garbage can. We want to do this be make a strip with IR-LEDs and IR-Receivers. When one of the lights get's interrupted someone throws something into the garbage can.

(I know there are different solutions, but this is how the project is at the moment)

Does someone has a circuit design maybe? Or knows some sensors I could use?

Roxlu
4  Forum 2005-2010 (read only) / Interfacing / Re: Interfacing LED-driver on: December 31, 2008, 05:16:03 am
Hi Rick,

As we had only 2 weeks we threw away these led-drivers and started using shift registers. We had to drive huge 7-segment LEDs (4 inch) so the shift registers we used could handle ±  20V.  (If you want I can give you the type number).

Gr. Roxlu
5  Forum 2005-2010 (read only) / Interfacing / Re: Interfacing LED-driver on: December 07, 2008, 08:14:06 am
hi,

This is my code

int data = 4;
int enable = 2;
int clock = 6;
int write_data = 0xFF;
int count = 0;
void setup()
{

 pinMode(data, OUTPUT);
 pinMode(clock, OUTPUT);
 pinMode(enable, OUTPUT);
}


void PulseClock(void) {
   digitalWrite(clock, LOW);
   delayMicroseconds(20);
   digitalWrite(clock, HIGH);
   delayMicroseconds(50);
   digitalWrite(clock, LOW);
}

void enableOn() {
 digitalWrite(enable, HIGH);
}
void enableOff() {
  digitalWrite(enable, LOW);
}

void loop() {
 // Send config bit.
 enableOff();
 writeByte(0xFF);
 enableOn();

 // Send data
 enableOff();
 writeByte(0x00);
 writeByte(0x00);
 writeByte(0x00);
enableOn();
delay(500);

// Send data
 enableOff();
 writeByte(0xFF);
 writeByte(0xFF);
 writeByte(0xFF);
 enableOn();
 delay(300);

/*
 enableOff();
 writeByte(0xCC);
 enableOn();
 enableOff();
  writeByte(0xCC);
  writeByte(0xCC);
 enableOn();
*/
/*
 digitalWrite(clock, HIGH);
 delay(400);
  digitalWrite(clock, LOW);
  delay(400);
  */
}

void writeByte(int writeData) {
   for (count = 0; count < 8; count++) {
     writeBit(writeData & 01);
     writeData>>=1;
   }
}

void writeBit(boolean bHigh) {
 digitalWrite(clock, LOW);
 delayMicroseconds(10);


 if (bHigh == true) {
   digitalWrite(data, HIGH);
 }
 else {
   digitalWrite(data, LOW);
 }
// delayMicroseconds(10);



 digitalWrite(clock, HIGH);
 delayMicroseconds(10);
}
6  Forum 2005-2010 (read only) / Interfacing / Interfacing LED-driver on: December 06, 2008, 08:15:04 pm
Hi,

We've trying all day to interface the MC14489 7-segmented LED driver, but we cannot figure out how to drive it. We assume we need to control ik like this:

Sending data:
---------------
- set enable pin to low
- 1a)set clock to low
- 1b) make data pin high / low (for 1 / 0)
- 1c) make clock pin high
- Do 1 a-c for all data / bits.
- set enable pin to high.

This is the general way of shifting data (as we think we need to use).

Though we cannot drive the leds as the a-h pins stay low. Therefore
we think we aren't configuring the MC144 correctly. Can someone please
tell us how or describe how we need to configure or control this
driver??

Here is the datasheet:
http://www.freescale.com/files/timing_interconnect_access/doc/inactive/MC14489B.pdf

Roxlu

7  Forum 2005-2010 (read only) / Exhibition / Re: camera shutter tester on: May 14, 2009, 02:26:01 pm
Hi jerrya.net,

I need to create a 'garbage can' which detects if someone throws something into it.  Because of the specs of the project we want/need to  create a strip of IR-emitters and IR-receivers (like 10 pairs per garbage can).

I was wondering if you think I could use the parts you've used in your setup? As we need to create 4 garbage cans, we have 40 pairs which need to be checked.  Therefore we probably need shift registers.


Roxlu
Pages: [1]