• AVR Freaks

AnsweredHot!Converting PIC16F84 code to 16F877A

Page: 12 > Showing page 1 of 2
Author
ErfanH
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/06/03 15:42:05
  • Location: 0
  • Status: offline
2019/06/07 12:11:33 (permalink)
0

Converting PIC16F84 code to 16F877A

hey there 
well i have an assembly code that is going to drive a motor in 3 different speed by using a pushbutton written for 16F84
i have been trying to change it so that i could use it for 16F877a too but couldn't get to any answer. like using direct register address and  changing the header file 
Processor 16F84A 
#INCLUDE <P16f84.inc>
__CONFIG _XT_OSC & _WDT_OFF
;-------------------Defining Variables-------------------
num equ 0x0C
formerval equ 0x0D
count1 equ 0x0E
count2 equ 0x0F
cnt2 equ 0x10
no1 equ 0x11
no2 equ 0x12
status equ 0X03
TRISA equ 0x85
TRISB equ 0x86
porta equ 0x05
portb equ 0x06
org 0x00
GOTO main
;--------------------Primary Jobs------------------------
main ;clrwdt
  bsf status,5 ;select bank1
  movlw 0x00 ;w=0
  movwf TRISB ;PORTB output
  movlw 0xFF ;PORTA input
  movwf TRISA
  bcf status,5 ;select bank0
  movlw 0x00 ;w=0
  movwf num ;num=0
  movlw 0x00
  movwf formerval ;formerval=0
 ; movlw 0x00
 ; movwf porta ;$$$$$$$$$$$$$
  ;movlw 0x00 ;w=0
  ;movwf porta ;num=0
;-----------------------Check Port---------------------------
;will not got out of this loop unless porta=0
checkp ;clrwdt
  btfss porta,0
  GOTO ais0
  GOTO ais1
ais0 btfss formerval,0
  GOTO Fis0
  GOTO Fis1
Fis0 GOTO DNOC
Fis1 incf num ;num++
  movlw 0x00
  movwf formerval ;formerval=0x00
  GOTO DNOC
ais1 movlw 0x01
  movwf formerval ;formerval=0x01
  GOTO checkp
;---------------------Detecting No clicks (DNOC)---------------------
DNOC btfss num,0 ;testing 1st bit of num
  goto ch22nd ;if 1st bit=0
  goto ch2nd ;if 1st bit=1

ch22nd btfss num,1 ;testing 2nd bit if 1st bit=0
  goto numis0 ;if 2nd bit=0
  goto numis2 ;if 2nd bit=1
ch2nd btfss num,1 ;testing 2nd bit if 1st bit=1
  goto numis1 ;if 2nd bit=0
  goto numis3 ;if 2nd bit=1
;--------------------Speed Controling Using No clicks------------------
;num3 creates 40ms
numis3 movlw 0x00 ;now is the time to clear out num!
  movwf num ;num=0
  movlw d'1'
  movwf count1 ;setting higher order counter
  movlw d'1'
  movwf count2 ;setting lower order counter
  GOTO RUN ;Let's go to RUN the motor!
;num2 creates 20ms
numis2 movlw d'130'
  movwf count1 ;setting higher order counter
  movlw d'75'
  movwf count2 ;setting lower order counter
  GOTO RUN ;Let's go to RUN the motor!
;num1 creates 10ms
numis1 movlw d'130' ;130
  movwf count1 ;setting higher order counter
  movlw d'25' ;w=25
  movwf count2 ;setting lower order counter
  GOTO RUN ;Let's go to RUN the motor!
numis0 GOTO numis3
;-----------------------Running Motor----------------------
RUN movlw 0x00
  movwf portb ;portb=0xFF
  CALL PWMUP
  movlw 0xFF
  movwf portb ;portb=0x00
  CALL PWMDOWN
  GOTO checkp
;-----------------------PWMUP--------------------------------
PWMUP movf count2,0 ;w=count2
  movwf cnt2 ;cnt2=w=count2
Lin DECFSZ cnt2 ;cnt2=cnt2-1
  GOTO Lin
  DECFSZ count1 ;count1=count1-1
  GOTO PWMUP
  return
;---------------------------PWMDOWN--------------------------
;PWMDWON creates 8ms
PWMDOWN movlw d'130' ;w=130
  movwf no1 ;setting higher order counter
Lout movlw d'25' ;w=25
  movwf no2 ;setting lower order counter
Lin1 DECFSZ no2 ;cnt2=cnt2-1
  GOTO Lin1
  DECFSZ no1 ;count1=count1-1
  GOTO Lout
  return
END

what should i do ?
#1
1and0
Access is Denied
  • Total Posts : 9990
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re: Converting PIC16F84 code to 16F877A 2019/06/07 12:43:12 (permalink) ☄ Helpfulby ErfanH 2019/06/08 05:21:51
+2 (2)
You really should compare the data memory of both PIC devices.  RAM space starts at 0x20 (instead of 0x0C) for the 'F877A.
#2
pcbbc
Super Member
  • Total Posts : 1381
  • Reward points : 0
  • Joined: 2014/03/27 07:04:41
  • Location: 0
  • Status: online
Re: Converting PIC16F84 code to 16F877A 2019/06/07 20:04:09 (permalink)
+3 (3)
what should i do ?

You really should have a think as to exactly why you are replacing a $4.85 part with another near obsolete $4.82 one.
#3
ric
Super Member
  • Total Posts : 24593
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: offline
Re: Converting PIC16F84 code to 16F877A 2019/06/08 03:26:12 (permalink)
+1 (1)
Or put another way, replacing a 1998 part with a 2001 part, in 2019.
You could get a much nicer modern PIC16F part for less than half the price.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#4
ErfanH
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/06/03 15:42:05
  • Location: 0
  • Status: offline
Re: Converting PIC16F84 code to 16F877A 2019/06/08 05:23:25 (permalink)
0
hey guys I am limited to the lab equipment and have no other choice
#5
1and0
Access is Denied
  • Total Posts : 9990
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re: Converting PIC16F84 code to 16F877A 2019/06/08 07:10:43 (permalink)
+2 (2)
ErfanH

status equ 0X03
TRISA equ 0x85
TRISB equ 0x86
porta equ 0x05
portb equ 0x06


There is no need to equate these SFRs yourself. They are done in the device specific include file, all in uppercase letters.
 
Also, you should list all the config bits in your source file.
post edited by 1and0 - 2019/06/08 07:12:00
#6
dan1138
Super Member
  • Total Posts : 3288
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Converting PIC16F84 code to 16F877A 2019/06/08 13:07:56 (permalink) ☼ Best Answerby ErfanH 2019/06/20 21:30:57
+3 (3)
This is your PIC16F84A code with the formatting cleaned up:
; Target: PIC16F84A
        list n=0,c=255,r=DEC
        errorlevel -302         ; suppress warning: Register in operand not in bank 0.
#INCLUDE <p16f84a.inc>
        __CONFIG _XT_OSC & _WDT_OFF & _PWRTE_OFF & _CP_OFF
;-------------------Defining Variables-------------------
num     equ     0x0C
formerval equ   0x0D
count1  equ     0x0E
count2  equ     0x0F
cnt2    equ     0x10
no1     equ     0x11
no2     equ     0x12
        org     0x00
        goto    main
;--------------------Primary Jobs------------------------
main:
;       clrwdt
        bsf     STATUS,5        ;select bank1
        movlw   0x00            ;w=0
        movwf   TRISB           ;PORTB output
        movlw   0xff            ;PORTA input
        movwf   TRISA
        bcf     STATUS,5        ;select bank0
        movlw   0x00            ;w=0
        movwf   num             ;num=0
        movlw   0x00
        movwf   formerval       ;formerval=0
;       movlw   0x00
;       movwf   PORTA           ;$$$$$$$$$$$$$
;       movlw   0x00            ;w=0
;       movwf   PORTA           ;num=0
;-----------------------Check Port---------------------------
;will not got out of this loop unless PORTA=0
checkp:
;       clrwdt
        btfss   PORTA,0
        goto    ais0
        goto    ais1
ais0:   btfss   formerval,0
        goto    Fis0
        goto    Fis1
Fis0:   goto    DNOC
Fis1:   incf    num,F           ;num++
        movlw   0x00
        movwf   formerval       ;formerval=0x00
        goto    DNOC
ais1:   movlw   0x01
        movwf   formerval       ;formerval=0x01
        goto    checkp
;---------------------Detecting No clicks (DNOC)---------------------
DNOC:   btfss   num,0           ;testing 1st bit of num
        goto    ch22nd          ;if 1st bit=0
        goto    ch2nd           ;if 1st bit=1

ch22nd: btfss   num,1           ;testing 2nd bit if 1st bit=0
        goto    numis0          ;if 2nd bit=0
        goto    numis2          ;if 2nd bit=1
ch2nd:  btfss   num,1           ;testing 2nd bit if 1st bit=1
        goto    numis1          ;if 2nd bit=0
        goto    numis3          ;if 2nd bit=1
;--------------------Speed Controlling Using No clicks------------------
;num3 creates 40ms
numis3: movlw   0x00            ;now is the time to clear out   num!
        movwf   num             ;num=0
        movlw   d'1'
        movwf   count1          ;setting higher order counter
        movlw   d'1'
        movwf   count2          ;setting lower order counter
        goto    RUN             ;Let's go to RUN the motor!
;num2 creates 20ms
numis2: movlw   d'130'
        movwf   count1          ;setting higher order counter
        movlw   d'75'
        movwf   count2          ;setting lower order counter
        goto    RUN             ;Let's go to RUN the motor!
;num1 creates 10ms
numis1: movlw   d'130'          ;130
        movwf   count1          ;setting higher order counter
        movlw   d'25'           ;w=25
        movwf   count2          ;setting lower order counter
        goto    RUN             ;Let's go to RUN the motor!
numis0: goto    numis3
;-----------------------Running Motor----------------------
RUN:
        movlw   0x00
        movwf   PORTB           ;PORTB=0xFF
        call    PWMUP
        movlw   0xFF
        movwf   PORTB           ;PORTB=0x00
        call    PWMDOWN
        goto    checkp
;-----------------------PWMUP--------------------------------
PWMUP:
        movf    count2,W        ;w=count2
        movwf   cnt2            ;cnt2=w=count2
Lin:    decfsz  cnt2,F          ;cnt2=cnt2-1
        goto    Lin
        decfsz  count1,F        ;count1=count1-1
        goto    PWMUP
        return
;---------------------------PWMDOWN--------------------------
;PWMDWON creates 8ms
PWMDOWN:
        movlw   d'130'          ;w=130
        movwf   no1             ;setting higher order counter
Lout:   movlw   d'25'           ;w=25
        movwf   no2             ;setting lower order counter
Lin1:   decfsz  no2,F           ;cnt2=cnt2-1
        goto    Lin1
        decfsz  no1,F           ;count1=count1-1
        goto    Lout
        return
        end

 
This is your code ported to the PIC16F877A:
; Target: PIC16F877A
        list n=0,c=255,r=DEC
        errorlevel -302         ; suppress warning: Register in operand not in bank 0.
#INCLUDE <p16f877a.inc>
        __CONFIG _XT_OSC & _WDT_OFF & _PWRTE_OFF & _CP_OFF & _BOREN_OFF & _LVP_OFF & _CPD_OFF & _WRT_OFF
;-------------------Defining Variables-------------------
num     equ     0x20
formerval equ   0x21
count1  equ     0x22
count2  equ     0x23
cnt2    equ     0x24
no1     equ     0x25
no2     equ     0x26
        org     0x00
        goto    main
;--------------------Primary Jobs------------------------
main:
;       clrwdt
        bsf     STATUS,5        ;select bank1
        movlw   0x06
        movwf   ADCON1
        movlw   0x07
        movwf   CMCON
        movlw   0x00            ;w=0
        movwf   TRISB           ;PORTB output
        movlw   0xff            ;PORTA input
        movwf   TRISA
        bcf     STATUS,5        ;select bank0
        movlw   0x00            ;w=0
        movwf   num             ;num=0
        movlw   0x00
        movwf   formerval       ;formerval=0
;       movlw   0x00
;       movwf   PORTA           ;$$$$$$$$$$$$$
;       movlw   0x00            ;w=0
;       movwf   PORTA           ;num=0
;-----------------------Check Port---------------------------
;will not got out of this loop unless PORTA=0
checkp:
;       clrwdt
        btfss   PORTA,0
        goto    ais0
        goto    ais1
ais0:   btfss   formerval,0
        goto    Fis0
        goto    Fis1
Fis0:   goto    DNOC
Fis1:   incf    num,F           ;num++
        movlw   0x00
        movwf   formerval       ;formerval=0x00
        goto    DNOC
ais1:   movlw   0x01
        movwf   formerval       ;formerval=0x01
        goto    checkp
;---------------------Detecting No clicks (DNOC)---------------------
DNOC:   btfss   num,0           ;testing 1st bit of num
        goto    ch22nd          ;if 1st bit=0
        goto    ch2nd           ;if 1st bit=1

ch22nd: btfss   num,1           ;testing 2nd bit if 1st bit=0
        goto    numis0          ;if 2nd bit=0
        goto    numis2          ;if 2nd bit=1
ch2nd:  btfss   num,1           ;testing 2nd bit if 1st bit=1
        goto    numis1          ;if 2nd bit=0
        goto    numis3          ;if 2nd bit=1
;--------------------Speed Controlling Using No clicks------------------
;num3 creates 40ms
numis3: movlw   0x00            ;now is the time to clear out   num!
        movwf   num             ;num=0
        movlw   d'1'
        movwf   count1          ;setting higher order counter
        movlw   d'1'
        movwf   count2          ;setting lower order counter
        goto    RUN             ;Let's go to RUN the motor!
;num2 creates 20ms
numis2: movlw   d'130'
        movwf   count1          ;setting higher order counter
        movlw   d'75'
        movwf   count2          ;setting lower order counter
        goto    RUN             ;Let's go to RUN the motor!
;num1 creates 10ms
numis1: movlw   d'130'          ;130
        movwf   count1          ;setting higher order counter
        movlw   d'25'           ;w=25
        movwf   count2          ;setting lower order counter
        goto    RUN             ;Let's go to RUN the motor!
numis0: goto    numis3
;-----------------------Running Motor----------------------
RUN:
        movlw   0x00
        movwf   PORTB           ;PORTB=0xFF
        call    PWMUP
        movlw   0xFF
        movwf   PORTB           ;PORTB=0x00
        call    PWMDOWN
        goto    checkp
;-----------------------PWMUP--------------------------------
PWMUP:
        movf    count2,W        ;w=count2
        movwf   cnt2            ;cnt2=w=count2
Lin:    decfsz  cnt2,F          ;cnt2=cnt2-1
        goto    Lin
        decfsz  count1,F        ;count1=count1-1
        goto    PWMUP
        return
;---------------------------PWMDOWN--------------------------
;PWMDWON creates 8ms
PWMDOWN:
        movlw   d'130'          ;w=130
        movwf   no1             ;setting higher order counter
Lout:   movlw   d'25'           ;w=25
        movwf   no2             ;setting lower order counter
Lin1:   decfsz  no2,F           ;cnt2=cnt2-1
        goto    Lin1
        decfsz  no1,F           ;count1=count1-1
        goto    Lout
        return
        end

 
This is what is different:

Attached Image(s)

#7
ErfanH
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/06/03 15:42:05
  • Location: 0
  • Status: offline
Re: Converting PIC16F84 code to 16F877A 2019/06/20 21:32:00 (permalink)
0
dan1138
This is your PIC16F84A code with the formatting cleaned up:
; Target: PIC16F84A
        list n=0,c=255,r=DEC
        errorlevel -302         ; suppress warning: Register in operand not in bank 0.
#INCLUDE <p16f84a.inc>
        __CONFIG _XT_OSC & _WDT_OFF & _PWRTE_OFF & _CP_OFF
;-------------------Defining Variables-------------------
num     equ     0x0C
formerval equ   0x0D
count1  equ     0x0E
count2  equ     0x0F
cnt2    equ     0x10
no1     equ     0x11
no2     equ     0x12
        org     0x00
        goto    main
;--------------------Primary Jobs------------------------
main:
;       clrwdt
        bsf     STATUS,5        ;select bank1
        movlw   0x00            ;w=0
        movwf   TRISB           ;PORTB output
        movlw   0xff            ;PORTA input
        movwf   TRISA
        bcf     STATUS,5        ;select bank0
        movlw   0x00            ;w=0
        movwf   num             ;num=0
        movlw   0x00
        movwf   formerval       ;formerval=0
;       movlw   0x00
;       movwf   PORTA           ;$$$$$$$$$$$$$
;       movlw   0x00            ;w=0
;       movwf   PORTA           ;num=0
;-----------------------Check Port---------------------------
;will not got out of this loop unless PORTA=0
checkp:
;       clrwdt
        btfss   PORTA,0
        goto    ais0
        goto    ais1
ais0:   btfss   formerval,0
        goto    Fis0
        goto    Fis1
Fis0:   goto    DNOC
Fis1:   incf    num,F           ;num++
        movlw   0x00
        movwf   formerval       ;formerval=0x00
        goto    DNOC
ais1:   movlw   0x01
        movwf   formerval       ;formerval=0x01
        goto    checkp
;---------------------Detecting No clicks (DNOC)---------------------
DNOC:   btfss   num,0           ;testing 1st bit of num
        goto    ch22nd          ;if 1st bit=0
        goto    ch2nd           ;if 1st bit=1

ch22nd: btfss   num,1           ;testing 2nd bit if 1st bit=0
        goto    numis0          ;if 2nd bit=0
        goto    numis2          ;if 2nd bit=1
ch2nd:  btfss   num,1           ;testing 2nd bit if 1st bit=1
        goto    numis1          ;if 2nd bit=0
        goto    numis3          ;if 2nd bit=1
;--------------------Speed Controlling Using No clicks------------------
;num3 creates 40ms
numis3: movlw   0x00            ;now is the time to clear out   num!
        movwf   num             ;num=0
        movlw   d'1'
        movwf   count1          ;setting higher order counter
        movlw   d'1'
        movwf   count2          ;setting lower order counter
        goto    RUN             ;Let's go to RUN the motor!
;num2 creates 20ms
numis2: movlw   d'130'
        movwf   count1          ;setting higher order counter
        movlw   d'75'
        movwf   count2          ;setting lower order counter
        goto    RUN             ;Let's go to RUN the motor!
;num1 creates 10ms
numis1: movlw   d'130'          ;130
        movwf   count1          ;setting higher order counter
        movlw   d'25'           ;w=25
        movwf   count2          ;setting lower order counter
        goto    RUN             ;Let's go to RUN the motor!
numis0: goto    numis3
;-----------------------Running Motor----------------------
RUN:
        movlw   0x00
        movwf   PORTB           ;PORTB=0xFF
        call    PWMUP
        movlw   0xFF
        movwf   PORTB           ;PORTB=0x00
        call    PWMDOWN
        goto    checkp
;-----------------------PWMUP--------------------------------
PWMUP:
        movf    count2,W        ;w=count2
        movwf   cnt2            ;cnt2=w=count2
Lin:    decfsz  cnt2,F          ;cnt2=cnt2-1
        goto    Lin
        decfsz  count1,F        ;count1=count1-1
        goto    PWMUP
        return
;---------------------------PWMDOWN--------------------------
;PWMDWON creates 8ms
PWMDOWN:
        movlw   d'130'          ;w=130
        movwf   no1             ;setting higher order counter
Lout:   movlw   d'25'           ;w=25
        movwf   no2             ;setting lower order counter
Lin1:   decfsz  no2,F           ;cnt2=cnt2-1
        goto    Lin1
        decfsz  no1,F           ;count1=count1-1
        goto    Lout
        return
        end

 
This is your code ported to the PIC16F877A:
; Target: PIC16F877A
        list n=0,c=255,r=DEC
        errorlevel -302         ; suppress warning: Register in operand not in bank 0.
#INCLUDE <p16f877a.inc>
        __CONFIG _XT_OSC & _WDT_OFF & _PWRTE_OFF & _CP_OFF & _BOREN_OFF & _LVP_OFF & _CPD_OFF & _WRT_OFF
;-------------------Defining Variables-------------------
num     equ     0x20
formerval equ   0x21
count1  equ     0x22
count2  equ     0x23
cnt2    equ     0x24
no1     equ     0x25
no2     equ     0x26
        org     0x00
        goto    main
;--------------------Primary Jobs------------------------
main:
;       clrwdt
        bsf     STATUS,5        ;select bank1
        movlw   0x06
        movwf   ADCON1
        movlw   0x07
        movwf   CMCON
        movlw   0x00            ;w=0
        movwf   TRISB           ;PORTB output
        movlw   0xff            ;PORTA input
        movwf   TRISA
        bcf     STATUS,5        ;select bank0
        movlw   0x00            ;w=0
        movwf   num             ;num=0
        movlw   0x00
        movwf   formerval       ;formerval=0
;       movlw   0x00
;       movwf   PORTA           ;$$$$$$$$$$$$$
;       movlw   0x00            ;w=0
;       movwf   PORTA           ;num=0
;-----------------------Check Port---------------------------
;will not got out of this loop unless PORTA=0
checkp:
;       clrwdt
        btfss   PORTA,0
        goto    ais0
        goto    ais1
ais0:   btfss   formerval,0
        goto    Fis0
        goto    Fis1
Fis0:   goto    DNOC
Fis1:   incf    num,F           ;num++
        movlw   0x00
        movwf   formerval       ;formerval=0x00
        goto    DNOC
ais1:   movlw   0x01
        movwf   formerval       ;formerval=0x01
        goto    checkp
;---------------------Detecting No clicks (DNOC)---------------------
DNOC:   btfss   num,0           ;testing 1st bit of num
        goto    ch22nd          ;if 1st bit=0
        goto    ch2nd           ;if 1st bit=1

ch22nd: btfss   num,1           ;testing 2nd bit if 1st bit=0
        goto    numis0          ;if 2nd bit=0
        goto    numis2          ;if 2nd bit=1
ch2nd:  btfss   num,1           ;testing 2nd bit if 1st bit=1
        goto    numis1          ;if 2nd bit=0
        goto    numis3          ;if 2nd bit=1
;--------------------Speed Controlling Using No clicks------------------
;num3 creates 40ms
numis3: movlw   0x00            ;now is the time to clear out   num!
        movwf   num             ;num=0
        movlw   d'1'
        movwf   count1          ;setting higher order counter
        movlw   d'1'
        movwf   count2          ;setting lower order counter
        goto    RUN             ;Let's go to RUN the motor!
;num2 creates 20ms
numis2: movlw   d'130'
        movwf   count1          ;setting higher order counter
        movlw   d'75'
        movwf   count2          ;setting lower order counter
        goto    RUN             ;Let's go to RUN the motor!
;num1 creates 10ms
numis1: movlw   d'130'          ;130
        movwf   count1          ;setting higher order counter
        movlw   d'25'           ;w=25
        movwf   count2          ;setting lower order counter
        goto    RUN             ;Let's go to RUN the motor!
numis0: goto    numis3
;-----------------------Running Motor----------------------
RUN:
        movlw   0x00
        movwf   PORTB           ;PORTB=0xFF
        call    PWMUP
        movlw   0xFF
        movwf   PORTB           ;PORTB=0x00
        call    PWMDOWN
        goto    checkp
;-----------------------PWMUP--------------------------------
PWMUP:
        movf    count2,W        ;w=count2
        movwf   cnt2            ;cnt2=w=count2
Lin:    decfsz  cnt2,F          ;cnt2=cnt2-1
        goto    Lin
        decfsz  count1,F        ;count1=count1-1
        goto    PWMUP
        return
;---------------------------PWMDOWN--------------------------
;PWMDWON creates 8ms
PWMDOWN:
        movlw   d'130'          ;w=130
        movwf   no1             ;setting higher order counter
Lout:   movlw   d'25'           ;w=25
        movwf   no2             ;setting lower order counter
Lin1:   decfsz  no2,F           ;cnt2=cnt2-1
        goto    Lin1
        decfsz  no1,F           ;count1=count1-1
        goto    Lout
        return
        end

 
This is what is different:



thank you very much !
I could get it to work at last !
 
#8
1and0
Access is Denied
  • Total Posts : 9990
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re: Converting PIC16F84 code to 16F877A 2019/06/21 03:20:49 (permalink)
+3 (3)
ErfanH
I could get it to work at last !

Nice to have someone do your homework for you. Huh. ;)
#9
dan1138
Super Member
  • Total Posts : 3288
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Converting PIC16F84 code to 16F877A 2019/06/21 11:26:39 (permalink)
0
1and0
ErfanH
I could get it to work at last !

Nice to have someone do your homework for you. Huh. ;)

Oh how can you say that!
The OP has been struggling with limited resources.
Just needed a little help. :)
#10
1and0
Access is Denied
  • Total Posts : 9990
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re: Converting PIC16F84 code to 16F877A 2019/06/21 14:11:07 (permalink)
+4 (4)
dan1138
 
Oh how can you say that!
The OP has been struggling with limited resources.
Just needed a little help. :)

Who does not struggle with schools and homeworks? Handling them a fully completed assignment ready to be turned in is more than a little help. ;) Many time (from personal experiences) they will just turn it in as-is without a second look to understand how it works -- either don't have the time, don't understand it at all, got a party to go to, or whatnot.
 
To me, that is not a good learning process. Rather, it is expected to struggle in the process of learning, and what it takes to solve a problem by persisting through that struggle. Anyway, I believe we had this discussion before where someone said handling students completed assignment would short-circuit the learning process. 
 
What limited resources? I'm willing to bet OP would struggle just the same if not more even when he has the latest equipment and PIC devices, which are a lot more complicated than these two ancient PIC16 parts.
 
Just my two cents. ;)
 

P.S. This reminds me of the recognition ceremony, that we attended recently, to honor seventh graders who scored exceptionally well on their college entry exams, where one of the speakers talked about a butterfly's struggle to get out of its chrysalis is NECESSARY.
 
#11
dan1138
Super Member
  • Total Posts : 3288
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Converting PIC16F84 code to 16F877A 2019/06/21 16:14:08 (permalink)
+1 (1)
1and0
dan1138
 Oh how can you say that!
The OP has been struggling with limited resources.
Just needed a little help. :)

Who does not struggle with schools and homework? Handling them a fully completed assignment ready to be turned in is more than a little help. ;) ...  that we attended recently, to honor seventh graders who scored exceptionally well on their college entry exams, where one of the speakers talked about a butterfly's struggle to get out of its chrysalis is NECESSARY.

I understand that struggling to achieve a worthy goal enhances and solidifies the learning experience.
 
The code I provided in this specific case comes from the place of enlightened self interest.
 
I figure the more a person feels entitled the less possessed they are of any critical thinking skills. Because I went to so much trouble and effort acquire these skills I am better at using them. This makes me a better candidate for employment.
 
So for me providing homework that are complete and correct ready to be handed in improves my employment prospects. :)
#12
1and0
Access is Denied
  • Total Posts : 9990
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re: Converting PIC16F84 code to 16F877A 2019/06/21 20:58:27 (permalink)
+3 (3)
Continuing the butterfly story. ;) A butterfly struggles for hours to get out of its chrysalis.
 
If someone tries to help the butterfly out of its chrysalis by slitting the chrysalis open. The butterfly that emerged will have small unformed wings and die soon after. It needs the struggle out of the chrysalis to force fluid into its wings to stretch and open them so that the butterfly can fly. By trying to shortcut this process, that someone will instead doom the creature.
 
#13
mlp
boots too small
  • Total Posts : 825
  • Reward points : 0
  • Joined: 2012/09/10 15:12:07
  • Location: previously Microchip XC8 team
  • Status: offline
Re: Converting PIC16F84 code to 16F877A 2019/06/21 21:03:35 (permalink)
+2 (2)
1and0
By trying to shortcut this process, that someone will instead doom the creature.

And as Dan explained, he is in no way attempting to do the same.
Oh, my mistake: that is exactly what he's doing.

Mark (this opinion available for hire)
#14
drh
30+ years
  • Total Posts : 1054
  • Reward points : 0
  • Joined: 2004/07/12 11:43:22
  • Location: Hemet, Calif. USA
  • Status: offline
Re: Converting PIC16F84 code to 16F877A 2019/06/22 06:58:56 (permalink)
0
It's a dog eat dog world. sad: sad

David
#15
dan1138
Super Member
  • Total Posts : 3288
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Converting PIC16F84 code to 16F877A 2019/06/23 09:23:29 (permalink)
0
@1and0,
 
My wife told me that I am wrong and that you are right.
 
So in order to keep my life happy I wish to acknowledge that I am wrong and apologize for posting code that was too helpful for the Original Poster. I am deeply sorry for the tragic consequences of my self serving act and hope that, in time, the Original Poster's educational experience can recover.
#16
dan1138
Super Member
  • Total Posts : 3288
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Converting PIC16F84 code to 16F877A 2019/06/23 09:23:29 (permalink)
0
Duplicate post, Thank you forum software.
post edited by dan1138 - 2019/06/23 09:24:57
#17
Jim Nickerson
User 452
  • Total Posts : 6371
  • Reward points : 0
  • Joined: 2003/11/07 12:35:10
  • Location: San Diego, CA
  • Status: online
Re: Converting PIC16F84 code to 16F877A 2019/06/23 10:35:12 (permalink)
+2 (2)
+1 for your wife, and for the instructor for making sure the answer was not readily available on the net.
#18
1and0
Access is Denied
  • Total Posts : 9990
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re: Converting PIC16F84 code to 16F877A 2019/06/23 23:36:42 (permalink)
+1 (1)
Two golden rules to a happy marriage:
1. The wife is always right.
2. When you feel she is wrong, slap yourself and read rule number 1 again.
Smile: Smile
 

Off topic.
The college admission exams that I mentioned earlier are usually taken by students in their 11th grade. I was amazed by these 7th graders who scored above 95% of high school students going to college taking these exams. Some even earned perfect scores in at least one subtest of these exams.
 
#19
1and0
Access is Denied
  • Total Posts : 9990
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re: Converting PIC16F84 code to 16F877A 2019/06/24 01:36:31 (permalink)
0
JANickerson
... for the instructor for making sure the answer was not readily available on the net.

I doubt that as these lab classes are usually supervised by lab assistant, teaching assistant, or research assistant, who are busy with their own research and/or class loads.
#20
Page: 12 > Showing page 1 of 2
Jump to:
© 2019 APG vNext Commercial Version 4.5