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.

Problem with BSF in a PIC assembler program...

Status
Not open for further replies.

si2030

Member
Hi all,

I am new to all this but am having a go at learning it. I am working on a simple program to operate a LCD from a PIC16F877A microprocessor.

I am having trouble with these lines:

MOVLW H'30' ;SET LCD-DB4-RC4/DB5-RC5 HIGH - (FIRST).
MOVWF PORTC

BSF PORTC,LCD_E ;SET LCD_E = HIGH.
CALL WAIT_64MS
BCF PORTC,LCD_E ;SET LCD_E = LOW.

In particular the "BSF PORTC,LCD_E" line.

I have set "LCD_E" as "8" in the equates. By rights it should change PORTC from '00110000' to '00111000' but instead I am watching the file register to '00110001'.

The program compiles and all I wanted to do at this stage is check that all the registers are getting what they should but this has confused me.

I have included the program as it stands right now.

Kind Regards

Simon
 

Attachments

  • LCD 1-0..asm
    12.7 KB · Views: 168
LOL yep that'll do it. You want to set bit 3 in the equates, not bit 8.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top