MPLAB SIM

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?

(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?

John
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…