Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

18f452 software reset in mikroc pro

Status
Not open for further replies.

madhushan90

Newbie level 6
Joined
Jul 26, 2012
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,362
Hi,

Can anyone tell me how to reset 18f452 micro controller in mikro c pro code.

thanks.
 

hello

i think this PIC has no reset instruction as new one.

if your init sequence is correct , it means all I/O are initialised , not by default value on (hardware ) reset
you can use a
_asm
goto 0x0000h // if no bootloader !
_endasm


or maybe use an output like RA4 open collector ,in parrallele with MCLR (reset)
and write 0 on it. => Hardware reset. ( a pull up resistance is needeed for the MCLR pin ie: 10K to VDD)
 
hello

i think this PIC has no reset instruction as new one.

if your init sequence is correct , it means all I/O are initialised , not by default value on (hardware ) reset
you can use a
_asm
goto 0x0000h // if no bootloader !
_endasm


or maybe use an output like RA4 open collector ,in parrallele with MCLR (reset)
and write 0 on it. => Hardware reset. ( a pull up resistance is needeed for the MCLR pin ie: 10K to VDD)

Thanks paulfjujo, but i can not find out implement this in mikroc pro. Can anyone help me to figure it out. regards
 

Thanks paulfjujo, but i can not find out implement this in mikroc pro. Can anyone help me to figure it out. regards

you can implement
Code:
 _asm 
goto 0x0000h // if no bootloader !
_endasm
in mikroC

---------update------------------

yes this code is not working in mikroC

Code:
void main() {
    TRISB = 0x00;
    PORTB = 0x00;
    PORTB.F0 = 1;
    Delay_ms(3000);
    asm {
        goto 0x0000    // if no bootloader !
    }
    Delay_ms(3000);
}

Check this

http://www.mikroe.com/forum/viewtopic.php?f=88&t=28198
 
Last edited:

I think your code is working. But it can not identify because it doesn't do any change to the state of led. try this and you can find out it is working.
Code:
void main() {
    TRISB = 0x00;
    PORTB = 0x00;
    PORTB.F0 = 1;
    Delay_ms(3000);
    PORTB.F0 = 0;
    Delay_ms(3000);
    asm {
        goto 0x0000    // if no bootloader !
    }
    Delay_ms(3000);
}
regards.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top