avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] RE: [AVR-Chat] RE: [AVR club] STK500 Demo file rewritten


From: Steven Chang-Lin Yu
Subject: [avr-gcc-list] RE: [AVR-Chat] RE: [AVR club] STK500 Demo file rewritten in C, almost completed!!!
Date: Tue, 20 Jan 2004 17:02:49 +1000

Thanks for that, I see what I need to do now!!!

 

-----Original Message-----
From: Dave Hylands [mailto:address@hidden 
Sent: Tuesday, 20 January 2004 3:50 PM
To: address@hidden; AVR-GCC; AVR-Chat
Subject: [AVR-Chat] RE: [AVR club] STK500 Demo file rewritten in C, almost
completed!!!

 

The ASM sample msu be doing a rotate, rather than a shift (the AVR may
use slightly different terminology - I'm more familiar with 68k
assembler). To do the same thing in C, you need to manually do the
rotate, unless you're going to use inline assembler.

Performing the operation manually would enatail something like the
following:

      if (( var & 0x80 ) != 0 )
      {
            var <<= 1;
            var |= 1;
      }
      else
      {
            var <<= 1;
      }

In the opposite direction:

      if (( var & 1 ) != 0 )
      {
            var >>= 1;
            var |= 0x80;
      }
      else
      {
            var >>= 1;
      }

--
Dave Hylands
Vancouver, BC, Canada
HYPERLINK "http://www.DaveHylands.com/"http://www.DaveHylands.com/


> -----Original Message-----
> From: Steven Chang-Lin Yu [mailto:address@hidden 
> Sent: Monday, January 19, 2004 9:27 PM
> To: 'AVR-GCC'; 'AVR-Chat'; 'AVRCLUB'
> Subject: [AVR club] STK500 Demo file rewritten in C, almost 
> completed!!!
> 
> 
> Guys, I have almost complete the file of the STK500 demo file 
> shows in the manual of the STK500 and preload on the 8515 
> came with the STK500.  The only problem now is the two shift 
> right and shift left function!!!
> 
>  
> 
> With the original asm demo, the shift left and shift right 
> shift the entire data in the temp registry, and do it as a 
> loop!!!  However by using the >>= or <<= in C, once all the 
> package have been shifted to the end, only one led is 
> continue in the loop rather than the whole package.  If you 
> don't understand, here is an example!!!
> 
>  
> 
> ASM Demo
> 
>  
> 
> 01111000 -> 00111100 -> 00011110 -> 00001111 -> 10000111 -> 
> 11000011 - > 11100001 -> 11110000 -> 01111000 -> 00111100
> 
>  
> 
> My Program using either (temp >>=1) or (temp <<= 1)
> 
>  
> 
> 01111000 -> -> 00111100 -> 00011110 -> 00001111 -> 00000111 
> -> 00000011 -> 00000001 -> 00000000 -> 10000000 -> 01000000 
> -> 00100000
> 
>  
> 
> I have include the latest build, and if anyone know how to 
> fix it, please let me know, and I will put your name in the 
> author place as well!!!
> 
>  
> 
> Thanks
> 
>  
> 
> Steven
> 
>  
> 
> __________________________________________________________________
> Steven Chang-Lin Yu
> ICQ#: 66369374
> 
> 
> Current ICQ status:  
> 
> 
> 
> * Home Tel#:  0401043641
> * Work Tel#:  0401043641
> *  HYPERLINK "HYPERLINK
"http://wwp.icq.com/66369374"http://wwp.icq.com/66369374"More ways to
contact me 
>        HYPERLINK "HYPERLINK
"http://wwp.icq.com/target="http://wwp.icq.com/target=";
> 
>  
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (HYPERLINK
"http://www.grisoft.com)."http://www.grisoft.com).
> Version: 6.0.564 / Virus Database: 356 - Release Date: 19/01/2004
>  
>     
> 
> 
> [Non-text portions of this message have been removed]
> 
> 
>  
> 
> Yahoo! Groups Links
> 
> To visit your group on the web, go to:  
> HYPERLINK
"http://groups.yahoo.com/group/avrclub/"http://groups.yahoo.com/group/avrclu
b/
> 
> To unsubscribe from 
> this group, send an email to:  address@hidden
> 
> Your use of Yahoo! Groups is subject to:  
> HYPERLINK
"http://docs.yahoo.com/info/terms/"http://docs.yahoo.com/info/terms/ 
> 
> 
> 
> 






Yahoo! Groups Sponsor



ADVERTISEMENT
HYPERLINK
"http://rd.yahoo.com/SIG=12cva2km2/M=267637.4116732.5333197.1261774/D=egroup
web/S=1706554205:HM/EXP=1074664216/A=1945637/R=0/*http:/www.netflix.com/Defa
ult?mqso=60178397&partid=4116732"click here


 HYPERLINK
"http://us.adserver.yahoo.com/l?M=267637.4116732.5333197.1261774/D=egroupmai
l/S=:HM/A=1945637/rand=595217748"

 

   _____  

Yahoo! Groups Links

*         To visit your group on the web, go to:
HYPERLINK
"http://groups.yahoo.com/group/AVR-Chat/"http://groups.yahoo.com/group/AVR-C
hat/
  

*         To unsubscribe from this group, send an email to:
HYPERLINK
"mailto:address@hidden"AVR-Chat-un
address@hidden
  

*         Your use of Yahoo! Groups is subject to the HYPERLINK
"http://docs.yahoo.com/info/terms/"Yahoo! Terms of Service. 


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.564 / Virus Database: 356 - Release Date: 19/01/2004



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.564 / Virus Database: 356 - Release Date: 19/01/2004
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]