Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/09/01 20:53
Read: times


 
#9918 - RE: AT90S8515 Question
Hi Dan,

This is a site for 8052 microcontrollers, not AVRs! Never the less, here is some code that should light the LED, assuming you're not using B.0's (pin 1 on Port B) alternate function (T0 Clk.) and you have included "8515.def", and you're using avrasm!:

in r16,PORTB
ldi r17,$FE
and r16,r17
out PORTB,r16

Nice and easy. You should connect the LED so that it's anode is connected through a 330R to the +5V rail, and it's cathode is connected to Pin 1 of the '8515.

To turn the LED off, simply write

in r16,PORTB
ldi r17,$01
or r16,r17
out PORTB,r16

Obviously neither of these routines preserve r16 or r17.

Matt.

List of 6 messages in thread
TopicAuthorDate
AT90S8515 Question            01/01/70 00:00      
RE: AT90S8515 Question            01/01/70 00:00      
RE: AT90S8515 Question            01/01/70 00:00      
RE: AT90S8515 Question            01/01/70 00:00      
RE: AT90S8515 Question            01/01/70 00:00      
RE: AT90S8515 Question            01/01/70 00:00      

Back to Subject List