Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Timer interrupt on: December 08, 2012, 04:13:49 pm
I need a function which send one pulse of a specific lenght.

I have an arduino mega.

Code:
void Timer1Init(void)
{
 // TCCR1B |= 0x08;          //WGM12 bitje hoog maken in TCCR1B voor CTC timer mode
 // Gebruik timer1 'normal mode'
}

void Timer1Start(int wachttijd)
{
  digitalWrite(38, HIGH);     //Maak pin hoog bij het starten van de timer
  TCCR1B |= 0x02;              //CS11 bitje hoog maken in TCCR1B voor prescaler van 8, start de timer
  OCR1A = wachttijd;          //Geef de Top aan
}

void setup()
{
  pinMode(38, OUTPUT);
  sei();
  Timer1Init();          //Configureer timer 1
}

void loop()
{
  Timer1Start(2000);    //Wait 2000 x 5*10^-7 = 1 ms
  delay(1);
}


ISR (TIMER1_COMPA_vect)  //Voer ISR uit bij een Timer CTC compare match met OCR1A
{
  digitalWrite(38, LOW);
  TCCR1B &= 0xFD;        //Stop de clock source, schakel de timer uit
}



I use Timer1 in normal mode. In the function 'Timer1Start', the pin needs to go HIGH, start the timer, wait for the specific time length. If timer1 = 2000 (1 ms) the ISR should be executed in which pin 38 will go low and stop the timer.

I expected the pin to toggle every 1 ms, but nothing happened.

I hope someone could help me further.

Regards!

edit: I forgot the OCIE1A bit in TIMSK1.... but the signal isn't very stable now, anyone suggestions why this is the case?
2  Using Arduino / Programming Questions / Re: Really big resolution on a small input voltage range on: July 02, 2011, 02:22:38 pm
I know, but in the holiday I work there and make this accelerometers by my self.
So I diden't pay that!
3  Using Arduino / Programming Questions / Re: Really big resolution on a small input voltage range on: July 02, 2011, 02:07:18 pm
I use this accelerometer:

http://www.tiepie.com/en/products/Accessories/Miscellaneous/Accelerometer_TP-ACC20
4  Using Arduino / Programming Questions / Really big resolution on a small input voltage range on: July 02, 2011, 02:00:23 pm
Hello,

I have a accelerometer but the accelerometer has a offset of 1,5 volt.
And with 1G it has an ouput voltage from about 1,9 volt.
I would like to set the full resolution ( 10 bit ) to the input range from 1,5 volt to 2 volt.
I already used the analogReference function but I would like to increase the underbound.
It is also possible to use first a voltage divider but resistors aren't precies enough for this job.

5  Using Arduino / General Electronics / Re-flash the ATMEGA8U2 on: June 17, 2011, 12:21:16 pm
The ATmega8U2 firmware source code is available . The ATmega8U2 is loaded with a DFU bootloader, which can be activated by connecting the solder jumper on the back of the board (near the map of Italy) and then resetting the 8U2. You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X and Linux) to load a new firmware. Or you can use the ISP header with an external programmer (overwriting the DFU bootloader). See this user-contributed tutorial for more information.

The "See this user-contributed tutorial for more information" link doesn't work.
Where can I find this tutorial?
6  Using Arduino / General Electronics / Replacement FTDI IC (ATMEGA8U2) on: June 15, 2011, 12:38:56 pm
I would like to replace the FTDI IC the ATMEGA8U2.
I am almost sure that that is why my arduino isn't reconised by my computer.
I already resolderd the ic but that hasen't helped. So I want to replace it by a new one.
Is is possible to just buy the ATMEGA8U2, or need it to be programed?
7  Using Arduino / General Electronics / Re: 1M resitor between the 16MHz kristal on the atmega328 on: June 12, 2011, 01:20:27 pm
http://arduino.cc/en/uploads/Main/arduino-uno-schematic.pdf
8  Using Arduino / General Electronics / 1M resitor between the 16MHz kristal on the atmega328 on: June 12, 2011, 01:14:18 pm
I want to make a standalone arduino.
In the schematic I see an 1M resistor between the XTAL1 and XTAL2.
But why is there a resistor, is this necessary for my standalone arduino?
9  Using Arduino / Programming Questions / Re: High refresh rate with a low refresh rate voor lcd on: May 25, 2011, 10:01:53 am
Thanks!
It works
10  Using Arduino / Programming Questions / High refresh rate with a low refresh rate voor lcd on: May 25, 2011, 08:12:08 am
I have wrote a program it works fine but, the data on my lcd get's very frequently updated, so I cant read it any more.
If I put a delay in the program the lcd works, but I need a high refresh rate for the rest of my program, how can I solve this problem?
Greetz,
Emiel

sory for my bad english
11  Forum 2005-2010 (read only) / Troubleshooting / Which waterproof temperature sensor? on: January 04, 2011, 08:45:53 am
Hello,

I need a temperature sensor for my arduino uno, but is has to be waterproof.
Temperature range about 0 to 100 degrees.
AD592 Temperature Probe this sensor looks waterproof.
I would like to have a waterproof temperature sensor that I can buy by antratek.com and is compatible with my arduino uno.

sorry for my bad english.
Pages: [1]