Post Created date
Simple function to convert letter to number (not hex)
For the most part, your function looks good. You may have some bugs lurking. Did you mean that 'o' (lowercase o) should return 24? In its current state, the function cannot...
Wednesday, 24 October 2012 - 04:25
need some division help
Dividing by a constant can generally be reduced to to a multiply and a shift as sparrow2 has pointed out. The accuracy of such methods is related to the range of values that must...
Tuesday, 18 October 2011 - 19:21
Wrong math results
Quote:What is the penalty for using 32bit integers? It it more CPU cycles?Yes. 32-bit multiplies will take roughly 3 times as long as 16-bit multiplies. Something else you may...
Thursday, 2 December 2010 - 05:41
Wrong math results
According to the rules for numeric expressions, the constant 35 is taken to be a 16-bit integer. The product of two 16-bit integers is also taken to be a 16-bit integer so the...
Wednesday, 1 December 2010 - 03:42
Attiny45 vs Attiny44
Welcome to the forum. Maybe you can find and use an ATtiny85 like the adapter builder did. That way you can reuse the code. Almost any other 8-bit AVR can probably be adapted for...
Saturday, 13 November 2010 - 01:20
[t2313] AVR overclocking
A 20MHz crystal provides a baud rate of 115200 with less than 1.4% error. This would generally be sufficient for accurate communication. If the the other end of the serial line...
Monday, 1 November 2010 - 03:21
[t2313] AVR overclocking
Any multiple of 1.8432MHz will get you a nearly zero error rate. 18.432MHz crystals are commonly available and wouldn't require overclocking. Many smaller multiples are also...
Monday, 1 November 2010 - 01:07
Stack vs. heap
Example 1 simply returns the constant 966, but Example 2 performs a computation using the given voltage parameter. With optimization turned on the compiler may recognize this and...
Wednesday, 21 April 2010 - 05:03
Shootout at the longbranch
Have you investigated using macros? Maybe something like this would be helpful: .macro jeq brne 1f rjmp @0 1: .endm . . . jeq reset
Wednesday, 17 March 2010 - 04:01
dynamic delays in us
Quote: void delay_us(uint16_t n) { while(n--) { _delay_us(1); } } (true in the realms of us the call/ret and loop in this will add an offset so you may need to "fiddle...
Friday, 5 February 2010 - 17:06
dynamic delays in us
If you get brave and would like to try an assembly language delay, you can try the following simple code with GCC (in a .S file): .global delay_us delay_us: clr r26 1...
Friday, 5 February 2010 - 06:46
Multi-byte maths
I presume that you are using unsigned quantities. If you use C and you can afford the speed it provides, 64-bit unsigned integers (unsigned long long) and shifts could do the...
Tuesday, 3 November 2009 - 03:49

Pages