2005-06-09 by Dave VanHorn
At 01:34 PM 6/9/2005, James Hatley wrote: >Good Job! Jeff ... wg0z ... I wouldn't have thought of that. Indeed! I don't see a lot of this sort of thing anymore, here, or on the piclist. Used to be, several years ago.. Thing is, now we need to collect these useful bits somewhere,
Thread view
Attachments: 0
2005-06-09 by James Hatley
Good Job! Jeff ... wg0z ... I wouldn't have thought of that. Jim ( k7tt ) ----- Original Message ----- From: wg0z@aol.com To: AVR-Chat@yahoogroups.com Sent: Thursday, June 09, 2005 11:11 AM Subject: Re: [AVR-Chat] Re: Challenge A = A XOR B B = B XOR A A = A XOR B -----Original Me
Thread view
Attachments: 0
2005-06-09 by Andreas Stemmer
Andreas Stemmer wrote: > Another solution: > > eor r1, r2 > eor r1, r2 > eor r1, r2 > > should work... but I can't prove it Arghhh, ten minutes too late and wrong as well eor r1, r2 eor r2, r1 eor r1, r2 of course! -- Andreas Stemmer
Thread view
Attachments: 0
2005-06-09 by Andreas Stemmer
> How do you swap the contents of 2 registers without using any other > registers or > stack? How about this one? A = A + B B = A - B A = A - B but I don't know how to do the second step in assembler... Another solution: eor r1, r2 eor r1, r2 eor r1, r2 should work... but I can't
Thread view
Attachments: 0
2005-06-09 by Ralph Hilton
On Thu, 09 Jun 2005 14:11:32 -0400 wg0z@aol.com wrote: >A = A XOR B >B = B XOR A >A = A XOR B You got it. Your turn to post a puzzle :-) >> > This one is known but can prove a puzzler if one doesn't know it. >> > >> > How do you swap the contents of 2 registers without using any
Thread view
Attachments: 0
2005-06-09 by arhodes19044
I have not checked your code yet, but..... Pinging all 3 sonars at the same time? It sounds (pun intended) to me as if interference will occur between sensors. If you are not running the sensors at max firing frequency, then it probably would be best to: ping Sensor-1 read Sensor
Thread view
Attachments: 0
2005-06-09 by wg0z@aol.com
A = A XOR B B = B XOR A A = A XOR B -----Original Message----- From: Zack Widup To: AVR-Chat@yahoogroups.com Sent: Thu, 9 Jun 2005 12:45:19 -0500 (CDT) Subject: Re: [AVR-Chat] Re: Challenge I could argue that you're using another register for that! :-) (I have used that on rare o
Thread view
Attachments: 0
2005-06-09 by Zack Widup
I could argue that you're using another register for that! :-) (I have used that on rare occasions though). Zack On Thu, 9 Jun 2005, James Hatley wrote: > Roll through carry. > > Jim > > > > > This one is known but can prove a puzzler if one doesn't know it. > > > > How do you sw
Thread view
Attachments: 0
2005-06-09 by Ralph Hilton
On Thu, 09 Jun 2005 14:23:54 -0300 you wrote: >On 9 Jun 2005 at 18:35, Ralph Hilton wrote: > >> This one is known but can prove a puzzler if one doesn't know it. >> >> How do you swap the contents of 2 registers without using any other >> registers or stack? > > Using Carry? (ROR
Thread view
Attachments: 0
2005-06-09 by Mark Jordan
On 9 Jun 2005 at 18:35, Ralph Hilton wrote: > This one is known but can prove a puzzler if one doesn't know it. > > How do you swap the contents of 2 registers without using any other > registers or stack? Using Carry? (ROR or ROL 8 times)
Thread view
Attachments: 0
2005-06-09 by Ralph Hilton
On Thu, 9 Jun 2005 09:50:38 -0700 you wrote: >Roll through carry. > >Jim ok. I should have said using no other storage, flags included. >----- Original Message ----- >From: "Ralph Hilton" >To: >Sent: Thursday, June 09, 2005 9:35 AM >Subject: Re: [AVR-Chat] Re: Challenge > > >> On
Thread view
Attachments: 0
2005-06-09 by James Hatley
Roll through carry. Jim ----- Original Message ----- From: "Ralph Hilton" To: Sent: Thursday, June 09, 2005 9:35 AM Subject: Re: [AVR-Chat] Re: Challenge > On Thu, 09 Jun 2005 11:21:50 -0500 you wrote: > > > > >> > >>It appears to require 6 shifts, six ANDs, and 5 ORs... seems un
Thread view
Attachments: 0
2005-06-09 by Dave VanHorn
> >This one is known but can prove a puzzler if one doesn't know it. > >How do you swap the contents of 2 registers without using any other >registers or >stack? Hmm. This one makes my head spin :)
Thread view
Attachments: 0
2005-06-09 by Ralph Hilton
On Thu, 09 Jun 2005 11:21:50 -0500 you wrote: > >> >>It appears to require 6 shifts, six ANDs, and 5 ORs... seems unlikely >>it would be faster than the "straightforward" implementation? It looks >>like a case of someone trying to be clever after they learned why a >>quicksort is
Thread view
Attachments: 0
2005-06-09 by Dave VanHorn
> >It appears to require 6 shifts, six ANDs, and 5 ORs... seems unlikely >it would be faster than the "straightforward" implementation? It looks >like a case of someone trying to be clever after they learned why a >quicksort is better than something like a bubble sort (what he do
Thread view
Attachments: 0
2005-06-09 by Dave VanHorn
> >Another thought is to use Hamming codes and write multiple copies. The >AVR has way more EEPROM than I really need as I have only about 20 bytes >total of parameters, plus need for a summing register. An approach I've used, is to start with it erased, and do readback verify on
Thread view
Attachments: 0
2005-06-09 by Tom Becker
> ... Distributing wear on EEPROM writes? ATEML appnote AVR101: http://www.atmel.com/dyn/resources/prod_documents/doc2526.pdf Tom Tom Becker --... ...-- GTBecker@RighTime.com www.RighTime.com The RighTime Clock Company, Inc., Cape Coral, Florida USA +1239 540 5700
Thread view
Attachments: 0
2005-06-09 by David Kelly
The classic example of what I'm thinking is an electronic odometer on a car. One must write periodically to nonvolatile memory such as EEPROM but limited to something like 10,000 erase/write cycles to represent 1,000,000.0 miles. Have heard mention of it somewhere before but can'
Thread view
Attachments: 0
2005-06-09 by Alex De Lara
I just landed on the backyard of the ATmegas and the first prototype is already on my sight.. however, as experience has taught me it is always good to assemble hardware prototypes in sockets. It happens that these ATmegas use 64 pins on MLF and TQFP which there is no easy fit ar
Thread view
Attachments: 0
2005-06-09 by Joel Kolstad
--- In AVR-Chat@yahoogroups.com, Peter Harrison wrote: > There is a fairly classic solution described on this page: > http://netghost.narod.ru/gff/graphics/book/ch06_04.htm > It does not look fast but, as far as I recall, it is. It appears to require 6 shifts, six ANDs, and 5 ORs
Thread view
Attachments: 0
2005-06-09 by James Hatley
Hello, Yes, you must set fuses ... but caution is warranted here ... knowledge is required ... Download and print the entire atmega16 full specification from the Atmel web site or avrfreaks and study up on fuses. Learn what they are, what they do, and how you need to set them. Do
Thread view
Attachments: 0
2005-06-09 by mirekwind
Al, moving codevision to c:\cvavr fixes the problems. The path cannot have embedded spaces. Installing it to c:\Program Files\cvavr on Windows XP causes this problem as "Program Files" contains embedded space. Thanks --- In AVR-Chat@yahoogroups.com, "alwelch93021" wrote: > --- In
Thread view
Attachments: 0
2005-06-09 by s sunder
I am doing a project with the use of PCF8593 IC Interfacing with At89c51 8 bit controllor. pcf8593 is a I2C RTC.That is working well, But i have problem in accesing minute alarm. The second alarm and 1/100 th alarm are working well, the only problem is minute alarm. Any one have
Thread view
Attachments: 0
2005-06-09 by aswinefy2003
hai What are the fuse bits do i have to program ifi am using atmega16 with 9.216 crystal
Thread view
Attachments: 0
2005-06-09 by wbounce
I am trying to diagnose a problem I am having with the devantech compass. I have 3 SRF08 sonars and a cmp03 compass connected to my MavricII board (M128). Using winavr 3.4.1. I am using a set I2C routines from Brian Dean's sample programs. I use the same routines to ping the sona
Thread view
Attachments: 0
2005-06-08 by John Samperi
At 11:49 PM 8/06/2005, you wrote: >it's called an > >exclusive-or with a 1 for all bits you want to flip. :-) > >I'm not talking about inversion, I'm talking about reversal, where >the data that was in bit 7 ends up in 0, 6 ends up in 1, and so on, >till 0 ends up in 7. Thank goo
Thread view
Attachments: 0
2005-06-08 by Peter Harrison
Paul Maddox wrote: > Dave, > > >>Then we have an even shorter variant possible: >>But, I maybe should have put the table option out as "obvious". >>Ok, what if I say "no tables"? > > > what are you? a sadist? > I guess this isn't a 'real world' application, but, more of a questio
Thread view
Attachments: 0
2005-06-08 by alwelch93021
--- In AVR-Chat@yahoogroups.com, "mirekwind" wrote: > does anyone know why codevision refuses to create COF file even if such > format is selected in project setup? Also "Errors occured during > assembly" is displayed but .asm file is created without errors. > thanks for any feed
Thread view
Attachments: 0
2005-06-08 by Bernd Felsche
On Wednesday 08 June 2005 21:49, Dave VanHorn wrote: > >You do... but despite my being able to rake in the millions by > >patenting the bleeding obvious in the USA, it's called an > >exclusive-or with a 1 for all bits you want to flip. :-) > I'm not talking about inversion, I'm t
Thread view
Attachments: 0
2005-06-08 by Dave VanHorn
> >I just wanted to say, I had to do this before, when a the guy who did the >PCB for a project made a mistake and reversed all the bits on a port and >no-one noticed until the code didn't work properly.. >As the board was already assembled and hardwired (SMD) we had to use the >
Thread view
Attachments: 0
2005-06-08 by Paul Maddox
Hi, > I'm not talking about inversion, I'm talking about reversal, where > the data that was in bit 7 ends up in 0, 6 ends up in 1, and so on, > till 0 ends up in 7. I just wanted to say, I had to do this before, when a the guy who did the PCB for a project made a mistake and rev
Thread view
Attachments: 0
2005-06-08 by Dave VanHorn
> >You do... but despite my being able to rake in the millions by >patenting the bleeding obvious in the USA, it's called an >exclusive-or with a 1 for all bits you want to flip. :-) I'm not talking about inversion, I'm talking about reversal, where the data that was in bit 7 end
Thread view
Attachments: 0
2005-06-08 by Dave VanHorn
At 08:45 AM 6/8/2005, Paul Maddox wrote: >Dave, > > > Then we have an even shorter variant possible: > > But, I maybe should have put the table option out as "obvious". > > Ok, what if I say "no tables"? > >what are you? a sadist? >I guess this isn't a 'real world' application, b
Thread view
Attachments: 0
2005-06-08 by Paul Maddox
Dave, > Then we have an even shorter variant possible: > But, I maybe should have put the table option out as "obvious". > Ok, what if I say "no tables"? what are you? a sadist? I guess this isn't a 'real world' application, but, more of a question of "I wonder how you'd do this?
Thread view
Attachments: 0
2005-06-08 by Dave VanHorn
Then we have an even shorter variant possible: >REVERSE: > LDI R31,TABLE_LOC > MOV R30,TEMP > LPM TEMP But, I maybe should have put the table option out as "obvious". Ok, what if I say "no tables"?
Thread view
Attachments: 0
2005-06-08 by Paul Maddox
Dave, > Speed contest: Fast code desired, space is no object. > Task: Make UP look like Down by rotating all the bits in a byte. > Input in TEMP, output in TEMP2 or for bonus points, in TEMP, such that you want quick? and space isn't a problem? use a Look Up Table, and use LPM si
Thread view
Attachments: 0
2005-06-08 by Peter Gargano
Bernd Felsche wrote: >>We have rotate and swap instructions, but not "flip" ... > > You do ... it's called an > exclusive-or with a 1 for all bits you want to flip. :-) Arrh, thart be magic and secret information Bernd - not to be carelessly disseminated to the heathen masses! P.
Thread view
Attachments: 0
2005-06-08 by Jeffrey Engel
Use a table with all the bits "pre-swapped"? Jeff Engel --- Dave VanHorn wrote: > > Speed contest: Fast code desired, space is no > object. > > Task: Make UP look like Down by rotating all the > bits in a byte. > > Input in TEMP, output in TEMP2 or for bonus points, > in TEMP, su
Thread view
Attachments: 0
2005-06-08 by Bernd Felsche
On Wednesday 08 June 2005 08:37, Dave VanHorn wrote: > At 07:15 PM 6/7/2005, Dave Hylands wrote: > > > I'm pretty sure this table is right. > >And what I often do is write a little C program which I compile on my > >PC that I use to generate source code for tables like this (or C
Thread view
Attachments: 0
2005-06-08 by Dave VanHorn
At 07:15 PM 6/7/2005, Dave Hylands wrote: > > I'm pretty sure this table is right. > >And what I often do is write a little C program which I compile on my >PC that I use to generate source code for tables like this (or CRC >lookups etc). > >I typically include the C program #if
Thread view
Attachments: 0
2005-06-08 by Dave Hylands
> I'm pretty sure this table is right. And what I often do is write a little C program which I compile on my PC that I use to generate source code for tables like this (or CRC lookups etc). I typically include the C program #if 0'd out in my source file that uses it as a way of d
Thread view
Attachments: 0
2005-06-07 by Dave VanHorn
> >Solution 1 > >Cross wire port A to Port B (or any other port combination. Output byte >on one port and read back on another. I like it! :) Interestingly enough, it's not THAT much faster than the table, but down here it counts. I'm pretty sure this table is right. reverse: ; 0
Thread view
Attachments: 0
2005-06-07 by Dave VanHorn
At 03:45 PM 6/7/2005, Richard Reeves wrote: > > > Speed contest: Fast code desired, space is no object. >Look-up table: > >fred: > ldi zl, low(reverse*2) > ldi zh, high(reverse*2) > add zl, temp > lpm temp,z > ret We have to add another instruction, unless as you specified, the t
Thread view
Attachments: 0
2005-06-07 by Richard Austin
Dave VanHorn wrote: > Speed contest: Fast code desired, space is no object. > > Task: Make UP look like Down by rotating all the bits in a byte. > > Input in TEMP, output in TEMP2 or for bonus points, in TEMP, such that > > Input: 7,6,5,4,3,2,1,0 10101110 or AE > > Routine happen
Thread view
Attachments: 0
2005-06-07 by erikc
James Hatley wrote: > Hi Dave, > > How about ROL TEMP then ROR TEMP2 etc. enough to move number. > > Jim Use TEMP to index into an array, result either to TEMP or TEMP2. After all, space is no object. erikc
Thread view
Attachments: 0
2005-06-07 by James Hatley
Hi Dave, How about ROL TEMP then ROR TEMP2 etc. enough to move number. Jim ----- Original Message ----- From: "Dave VanHorn" To: Sent: Tuesday, June 07, 2005 1:35 PM Subject: [AVR-Chat] Challenge > > Speed contest: Fast code desired, space is no object. > > Task: Make UP look lik
Thread view
Attachments: 0
2005-06-07 by Richard Reeves
> Speed contest: Fast code desired, space is no object. Look-up table: fred: ldi zl, low(reverse*2) ldi zh, high(reverse*2) add zl, temp lpm temp,z ret .org $xx00 reverse: .db I think that's six cycles if it's not a subroutine. Richard --- "Iz dana u dan ona dolazi i odlazi u tal
Thread view
Attachments: 0
2005-06-07 by Dave VanHorn
Speed contest: Fast code desired, space is no object. Task: Make UP look like Down by rotating all the bits in a byte. Input in TEMP, output in TEMP2 or for bonus points, in TEMP, such that Input: 7,6,5,4,3,2,1,0 10101110 or AE Routine happens, then Output: 0,1,2,3,4,5,6,7 011101
Thread view
Attachments: 0
2005-06-06 by mirekwind
does anyone know why codevision refuses to create COF file even if such format is selected in project setup? Also "Errors occured during assembly" is displayed but .asm file is created without errors. thanks for any feedback
Thread view
Attachments: 0
2005-06-06 by upand_at_them
--- In AVR-Chat@yahoogroups.com, Michael De Nil wrote: > SD / MMC has a serial inrterface and can be accessed using SPI, only > requiring 3 pins connected to the µC (Mosi, Miso & Sck). Plus Card Select, which is needed even if there is only one card. Mike
Thread view
Attachments: 0