Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Getting started is confusing.

Status
Not open for further replies.
Thanks guys!

I think I'm starting to get the hang of it...sort of...

I'm just trying to do something simple here, just cause...

How do I turn on two LED's at a time?

Code:
Start:
     bsf     STATUS,RP0       ; select Register Page 1
     clrf    TRISC          ; make IO Pin C0 an output
     bcf     STATUS,RP0       ; back to Register Page 0
     bsf     PORTC,0        ; turn on LED C0 (DS1)


     goto    $                ; wait here

     end

From what I understand it's making the TRISC all outputs, then turning on the LED on PORTC, 0 (which I am assuming is RA0).

How do I tell it to also light up the LED next to it? (PORTC, 1)

Thanks!

Simply add 'bsf PORTC,1' after your 'bsf PORTC,0', it may be wise to place a NOP between them as well.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top