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.

MPLAB SIM

Status
Not open for further replies.

koolguy

Active Member
Hello Guys,
The MPLAB showing error from the vision of code.
the output swing
PORTB=1100000000;
WHY, IN CODE THERE IS 0XFF;

C:
#include <htc.h>
__CONFIG( BOREN_OFF & PWRTE_OFF & WDTE_OFF & FOSC_HS);
#define _XTAL_FREQ 20000000
void main()
    {

    TRISB=0B0000000;

PORTB=0X00;

    while(1)
        {

PORTB=0X00;
//__delay_ms(500);
PORTB=0XFF;
//__delay_ms(5000);

    }
    }
 
AND PICK KIT 2 is also showing verification of program memory failed at address 0x00000?
i think i should buy new kit.
i have pick kit 2 from robokits india website 2 year back.
 
Is this setting correct?
upload_2015-10-19_11-49-59.png

(notice the "B")
When you say TRISA is set to analog, is that something special for C? In Assembly, TRIS sets the port direction. Ports are by default analog.

John
 
So, you mean that value as a binary literal, but you only set TRIS for 7 of the 8 pins on PortB. Why?
upload_2015-10-20_5-41-7.png

John
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top