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.

please small help for pic16f877a

Status
Not open for further replies.

the mask

Member level 2
Member level 2
Joined
Apr 16, 2010
Messages
51
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Location
jordan
Activity points
1,537
please small help

hi...
i try tow write simple code for pic16f877a to run five phase stepper motor my code written by microbasic(7002) and try to simulate in proteus 7 but when run in proteus 7 error shown to me(processor has been reset by watchdog timer expireing in time 10:00)
and dont work when i download in pic
microbasic code:
program one_proceure

main:
TRISB = $00
TRISD = $00
TRISC = $00
trisa = $00

PORTA=7

PORTB=0
PORTD=0
PORTC=0


FIRST:




PORTC.6=1
PORTC.2=1

Delay_ms(100)
PORTC.6=0
PORTC.2=0

PORTC.5=1
PORTC.3=1

Delay_ms(100)

PORTC.5=0
PORTC.3=0

PORTC.4=1
PORTD.0=1

Delay_ms(100)

PORTC.4=0
PORTD.0=0

PORTD.3=1
PORTD.1=1

Delay_ms(100)

PORTD.3=0
PORTD.1=0

PORTD.2=1
PORTC.1=1

Delay_ms(100)
GOTO FIRST
END.
 

Re: please small help

You have to restart watchdog in "FIRST" loop or set watchdog timer off.
 

    the mask

    Points: 2
    Helpful Answer Positive Rating
can you tell me how i can do it
(reset watchdog)
 

it is restart_wdt(); at ccs c, if you look at the manual of your compiler, "ClrWdt" should be the instruction.
You can reach the manual from here:
**broken link removed**
 

hi...
first thanks for all
but i try to put (ClrWdt) in first my loop(after label (first)) but the problem still
and i don't know how i can use (restart_wdt())
 

I think the best way is,
find edit project in the project tab. Open it. You will see configuration bits there. Set it as OFF, you won't have to think about watchdog anymore, until you need it :).
 

hi,
your codes run smoothly on my proteus 7.5


in your compiler

project -----> edit project" where you can turn off watchdog timer


to stop watchdog timer

codes:




Code:
 asm
           clrwdt

        end  asm
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top