Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20608

BASCOM-AVR : Translating C code to Bascom-AVR : REPLY

$
0
0
if you want to translate you need to study some C. DDRB=(0<<DDB7) | (0<<DDB6) | (1<<DDB5) | (0<<DDB4) | (0<<DDB3) | (1<<DDB2) | (0<<DDB1) | (0<<DDB0); in bascom : DDRB=bits(ddb5,ddb2) ' < means shift left and what they want to do is set these bits TCCR2B |= (1<<CS20) ; tcc2b.cs20=1 ' only set 1 bit, preserve the others TCCR2B &= ~(1<<CS21) ; tccr2b.cs21=0 'clear one bit or tccr2b=tccr2b and not 2^cs21 TCCR1B = TCCR1B & ~7; tccr1b=tccr1b and &B11111000 'reset only the 3 lower bits there are other ways too.

Viewing all articles
Browse latest Browse all 20608

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>