Post Created date
ICP Frequency capture
Quote: Why do you test TCNT1? I don't think it will have the effect you want. You need to add a timeout methinks. Read up on the timer compare feature. Enable a compare channel ....
Saturday, 19 May 2012 - 08:08
ICP Frequency capture
By looking at TCNT1 if it reaches 65535 it is at the end so do a restart. It was what i came up with, that i knew how to do & it worked. I cant work out your theory on what...
Saturday, 19 May 2012 - 04:08
ICP Frequency capture
Quote: Hey! That was me! Quote: I don't think so Tim lol. I think i know the guys name. Well, you legend. You just removed the two counts like that, man i wish i could have...
Friday, 18 May 2012 - 08:01
ICP Frequency capture
I think i see what you mean. Im not worried if i skip a value. After all it will be one every now & then. So i think the result will be the same in the space of a second. I...
Friday, 18 May 2012 - 05:16
ICP Frequency capture
The below is re-joined at the PC end so its readable. USART_SendByte(pulse); USART_SendByte(pulse>>8); I have found that the first capture is incorrect but it is fine after...
Friday, 18 May 2012 - 02:12
ICP Frequency capture
So do you mean skip the volatile & just int NewCapture = 0; I have also added to the code to stop incorrect values from being sent. It seems to work well. Is it ok to do...
Thursday, 17 May 2012 - 05:08
ICP Frequency capture
Quote: Why waste two bytes on a flag when one would do? What do you mean how would you do it? Quote: Also be cautious about passing anything but 8bits between ISR and main()....
Wednesday, 16 May 2012 - 22:03
ICP Frequency capture
I tested the code & it was crap as you suggested. I think this is what mnehpets was getting at. volatile uint16_t PulseWidth; //Kept in memory, not forgotten until re-...
Wednesday, 16 May 2012 - 14:18
ICP Frequency capture
I thought i had fixed the atomicity problem. The sound of that word drives me nuts. I read the atomicity thing but like all ways i get it wrong. I read this in the datasheet but...
Wednesday, 16 May 2012 - 13:51
ICP Frequency capture
Ok i have changed the code to the below after reading your replies, thank you. I forgot to say it was a for a Mega168. I want to read from high to high point again. So it will be...
Wednesday, 16 May 2012 - 11:38
ATmega324 Asynchronous timer wakeup
Quote: Now let's assume BIT is 2, what is now the result of the left side if that bit is 1 in REG? Ok so "result of the left side" means "Answer" Answer = while ((1 & (1<...
Tuesday, 1 May 2012 - 02:15
ATmega324 Asynchronous timer wakeup
I have only ever been able to learn by example. If there is a change to the example then i don't know what to do. e.g algebra was a lost cause to me, it seemed to be all guess...
Monday, 30 April 2012 - 23:19

Pages