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.

Help with pedestrian crossing program in MPASM assembler

Status
Not open for further replies.

prinsloo

Member level 5
Joined
Sep 19, 2004
Messages
93
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Location
Bethlehem RSA
Activity points
697
flowcode sample .fcf

Dear Members

I have written this pedestrian crossing, the one that I uploaded earlier.There is a problem when I send it to the PIC.
It does not work as it is suppose to-the simulation is a flowcode simulation and it work perfectly.

Included is the fcf file,hex, .asm, lst file.

I had to change:
_option_register to opt (see example)


pclath equ 0x0a ;1
intcon equ 0x0b ;1
opt equ 0x81 ;1
trisa equ 0x85 ;1
trisb equ 0x86

movlw D'192'
bsf STATUS, RP0
movwf OPT
label_0006
bsf STATUS, RP0

AND FCV_KEY equ 0x12 ;1
WAS _FCV_KEY equ 0x12 ;1


FCV_COUNT2 equ 0x10 ;1
FCV_WAIT equ 0x11 ;1
FCV_KEY equ 0x12 ;1
FCV_POLL equ 0x13 ;1

clrw
movwf FCV_KEY
movf FCV_KEY, W
btfsc STATUS, Z

Now the lights change without the button.

I use a MPASM assembler / programmer.I want to program a PIC16F84A.

The person that helps me will be thanked properly.
Thanks in advance.

Johan
 

Re: Help with MPASM pls

Check whether your configuration bits are correct or not
 

    prinsloo

    Points: 2
    Helpful Answer Positive Rating
Help with MPASM pls

Dear Members

I figered out what the problem is but I dont know how to change it. The flowcode program program the switch as
'ReadState (WhichSwitch)
This macro reads the state of a single switch, specified by the WhichSwitch parameter. The macro returns 0 if the switch is open or 1 if the switch is closed.'

The proto board I have returns 1 if the switch is open or 0 if the switch is closed.

How do I fix it? Can anybody please asist me? I don't know how to change the .asm file (download the RAR file).

Regards
Johan
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top