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.

[SOLVED] pwm generating asm code in pic 18f452

Status
Not open for further replies.

avinashnp007

Newbie level 3
Newbie level 3
Joined
Aug 20, 2013
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
27
I have asm program for generating pwm for pic18f452, i have checked it in proteus and it is working fine. But i dont kno why i am not getting any output when i implement it on hardware. here is the program.

LIST P=PIC18F452, F=INHX32, N=0, ST=OFF, R=HEX
#include P18F452.INC
CONFIG OSC=HS, OSCS=OFF
CONFIG WDT=OFF
CONFIG BORV=45, PWRT=ON, BOR=ON
CONFIG DEBUG=OFF, LVP=OFF, STVR=OFF
ORG 00H
BCF TRISC,CCP1
CLRF CCP1CON
CLRF TMR2
MOVLW D'124'
MOVWF PR2
MOVLW D'62'
MOVWF CCPR1L
MOVLW 0X0C
MOVWF CCP1CON
MOVLW 0X02
MOVWF T2CON
AGAIN BCF PIR1,TMR2ON
OVER BTFSS PIR1,TMR2ON
BRA OVER
GOTO AGAIN
END

plz check wheather configuration bits are correct....
 

Generally the major difference between a simulatoin working in proteus and no o/p in hw is due to the order of initializing the H/W . i.e the Control registers .. also Proteus takes default oscillator at times if u dont provide any .In h/w that doesnt happen u have to select the config registers correctly in order for the H/W to work properly .

use the pragma fields in mplab ..
In help ull find pic18 config settings .
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top