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?

(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
 
I don't know why we are guessing what micro you are using!!!
Assuming a pic16 (mid range )... You code runs fine.... It runs too fast without the delays, but it works..
 
So, you mean that value as a binary literal, but you only set TRIS for 7 of the 8 pins on PortB. Why?

John
 
yes, i set for whole portb but portb 7 and 6 are working rest portb 5-0 are always zero.!
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…