Show Posts
|
|
Pages: 1 [2] 3
|
|
18
|
Forum 2005-2010 (read only) / Français / Re: Une LED qui mesure l'éclairement et qui éclair
|
on: September 27, 2006, 09:46:56 am
|
Salut Benoit, Solution, mettre ceci dans la fonction setup() pour désactiver les "pull-up" : _SFR_IO8(0x30) |= 4; tu peux expliquer les details de ce morceau de code? ca desactive tout les pull-ups ou seulement les deux tu as utilisé? j'ai cherché dans la documentaion du Atmeg8 mais, j'ai rien trouvé. woo
|
|
|
|
|
19
|
Forum 2005-2010 (read only) / Troubleshooting / strange pin 13 behaviour when flashing via avrdude
|
on: September 05, 2006, 03:01:20 pm
|
|
hi,
i wrote a prog, where i have to youse all of the digital pins as output to multiplex many inputs. i used avrdude to flash the .hex file directly via isp to the atmega8 without bootloader, beceause of memory space reasons. but then pin 13 behaves differently (perhaps more than only this one), im not shure what. is the behaviour of the pins declared already in bootloader? so it makes a difference using the atmega8 without bootloader.
cheers woo
|
|
|
|
|
24
|
Forum 2005-2010 (read only) / Interfacing / Re: real time clock ds 1307
|
on: June 04, 2007, 11:07:53 am
|
|
I checked the Crystal it has a capacity of 12 pf - should work. But I tried as well with 22pF caps. Still the same. In some other forums about microkontrollers they write abut that you have to send a 'TWI write' first, then 'repeated (TWI) start' then you can Read the register. I guess i need to set the pointer without writing directly to the register.
any ideas?
best woo
|
|
|
|
|
25
|
Forum 2005-2010 (read only) / Interfacing / Re: real time clock ds 1307
|
on: June 03, 2007, 05:55:18 pm
|
|
Thanks for the fast reply,
I read that, bit 7 of register 00. But isnt it the same as the "seconds" Register? So it will be set with the _sec value, which is set to 4 (binary 00000010) at the moment? How to Adress the different registers, just by executing eg 3 times a Wire.send() line to acces the 3rd register?
best woo
|
|
|
|
|
26
|
Forum 2005-2010 (read only) / Interfacing / real time clock ds 1307
|
on: June 03, 2007, 05:13:29 pm
|
Hi, im trying to use the ds 1307 realtimeclock (datasheet: http://www.reichelt.de/?SID=208PfrUqwQARQAAH6JtH4852ebc6602248fba4d6fe06e77038d10;ACTION=7;LA=6;OPEN=1;INDEX=0;FILENAME=A200%252FDS_1307.pdf), connected via i2c two wire bus im able to set the the time (it seems like it works) , but if i try to read from the ds 1307 i get always the time and date i set up in 1307 memory. There is no increasement of time. I use a 32.768 kHz quartz crystal connected to he x1/x2 pins of the RTC, if I remove it there is the same behaviour, nothing changes. Here is the code I use: #include <Wire.h>
byte _sec =4; byte _min=8; byte _hour=3; byte _day =5; byte _date=2; byte _month=6; byte _year =7;
boolean state;
void setup() { Wire.begin(); // join i2c bus (address optional for master) Serial.begin(9600); pinMode(13, OUTPUT); Wire.beginTransmission(104); // transmit to device #104, the ds 1307
// **********setting time************** // Wire.send(sendung, 8); //sec Wire.send(_sec); //sec Wire.send(_min); //min Wire.send(_hour); //hour Wire.send(_day); //day Wire.send(_date); //date Wire.send(_month); //month // Wire.send(_year); //year
Wire.endTransmission(); // stop transmitting }
void loop() {
delay(100);
Wire.requestFrom(104, 6); // request 6 bytes from slave ds1307 while(Wire.available()) // slave may send less than requested { digitalWrite(13,state); //LED on pin 13 to see if there is activity state=!state; int c = Wire.receive(); Serial.println(c);
}
delay (100); }
thanks for help woo
|
|
|
|
|
29
|
Forum 2005-2010 (read only) / Interfacing / Re: Multiply the analog Outputs up to 12 channels
|
on: September 23, 2006, 06:13:43 pm
|
|
hi you could youse an analog multiplexer like described in tutorials thread. with that device you can send or recive a certain voltage, or a pulsed signal, or whatever via one wire to the ic where its spread (multiplexed) over up to 16 ch if you youse the 4067b for example. you need again 5 wires to controll the multiplexer. its a serial technique, so if you run the controll programm very quick it seems to be same time. if you combine them you'll have even more chs. costs around 1,50 eur.
regards woo
|
|
|
|
|