Show Posts
|
|
Pages: 1 [2] 3
|
|
18
|
Forum 2005-2010 (read only) / Troubleshooting / Re: Pulsein
|
on: July 12, 2007, 05:14:17 pm
|
|
Very good. Executing pulsein twice and taking the second value works perfectly. I measure consistent results from 10usec to 800ms with no problem. In my opinion the function should wait for the transition and then make the measurement for the duration of that high or low period depending on what you asked for. As if starting a stopwatch on the transition and stopping it on the next transition. Thanks.
|
|
|
|
|
19
|
Forum 2005-2010 (read only) / Troubleshooting / Re: Pulsein
|
on: July 12, 2007, 03:57:58 pm
|
|
It seems that the consistency of value is inversely proportional to the duty cycle of the pulse measured. My comments earlier were at 50% duty cycle. At 10-20% duty cycle the pulse is correctly measured about 80% of the time.
|
|
|
|
|
20
|
Forum 2005-2010 (read only) / Troubleshooting / Pulsein
|
on: July 12, 2007, 01:33:55 pm
|
|
In general I have had great luck with Arduino and enjoyed it very much. I am having difficulty with plusein however. It will not give a consistent result in the following sketch. I have tried both high and low transitions and have pulled the input pin to ground through a 10K resistor. I have also tried pulses from 3 usec to 100ms. In each case the output is generally about 50% correct with the balance all over the map. Thanks in advance.
long duration; int Signal = 7; void setup() { pinMode(Signal, INPUT); Serial.begin(9600); }
void loop() { duration = pulseIn(Signal, HIGH); Serial.println(duration); delay(1000); }
|
|
|
|
|
22
|
Forum 2005-2010 (read only) / Development / Re: Ok, on to Atmega32
|
on: July 16, 2008, 04:13:26 pm
|
|
OK, I was able to upload and burn the atmega644p, but not the atmega644 with the bootloader. The clock is running at 16mhz and the led on PB2 flashes appropriately. I can compile a sketch, but when I try to upload it, I get an avrdude error saying expected signature for atmega644p is blah blah. I have a 644p in the breadboard. When I tried to burn the bootloader into a atmega644 I received the same error. Can someone suggest how I might approach this?
|
|
|
|
|