Searching \ for 'Porting code.' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/ios.htm?key=port
Search entire site for: 'Porting code.'.

Truncated match.
PICList Thread
'Porting code.'
1998\10\01@193428 by netquake

flavicon
face
Hi!
I have to port source code from a Motorola MCU (68HC705K1)(16 pin, 8 i/o)
to a PIC
16F84 and I'm really lost (I'm not familiar with Mot. MCU's). Any thoughts,
advice,
help or point in the right direction is welcome.

Thank you very much!

P.D.: Source code is fairly short:

0300   BSET 1,000A
0302   LDA  #1
0304   STA  0004
       LDA #0FF
       STA  00E0
       CLRX
       BSET 0,0000
       CLI
       WAIT
 030F  LDA  0000
       BIT #2
       BEQ  0323
       BIT #4
       BEQ  0328
       CPX #60
       BCS 0321
       STX 00E0
       BSET 0,0000
 0321  RSP
       WAIT
 0323  CLRX
       BSET 0,0000
       RSP
       WAIT
 0328  INCX
       CPX 00E0
       BCS 0331
 032D  BSET 0,0000
 032F RSP
 0330  WAIT
 0331  LDA  0200,X
       STA  0000
       RSP
       WAIT
 0338  RTI

--------------------------------------------
"I must not fear. Fear is the mind-killer.
Fear is the little death that brings total
obliteration. I will face my fear... I will
permit it to pass over me and through me."

Kwisatz Haderach - Dune

       netQ
<spam_OUTnetquakeTakeThisOuTspaminnocent.com>

1998\10\01@194036 by netquake

flavicon
face
Hi!
I have to port source code from a Motorola MCU (68HC705K1)(16 pin, 8
i/o)(running with a 4Mhz XTAL)to a PIC16F84 and I'm really lost (I'm not
familiar with Mot. MCU's). Any thoughts, advice, help or point in the right
direction is welcome.

Thank you very much!

P.D.: Source code is fairly short:

0300   BSET 1,000A
0302   LDA  #1
0304   STA  0004
       LDA #0FF
       STA  00E0
       CLRX
       BSET 0,0000
       CLI
       WAIT
 030F  LDA  0000
       BIT #2
       BEQ  0323
       BIT #4
       BEQ  0328
       CPX #60
       BCS 0321
       STX 00E0
       BSET 0,0000
 0321  RSP
       WAIT
 0323  CLRX
       BSET 0,0000
       RSP
       WAIT
 0328  INCX
       CPX 00E0
       BCS 0331
 032D  BSET 0,0000
 032F RSP
 0330  WAIT
 0331  LDA  0200,X
       STA  0000
       RSP
       WAIT
 0338  RTI

--------------------------------------------
"I must not fear. Fear is the mind-killer.
Fear is the little death that brings total
obliteration. I will face my fear... I will
permit it to pass over me and through me."

Kwisatz Haderach - Dune

       netQ
<.....netquakeKILLspamspam@spam@innocent.com>

1998\10\02@011411 by Regulus Berdin

flavicon
face
netQ wrote:
>
> Hi!
> I have to port source code from a Motorola MCU (68HC705K1)(16 pin, 8 i/o)
> to a PIC
> 16F84 and I'm really lost (I'm not familiar with Mot. MCU's). Any thoughts,
> advice,
> help or point in the right direction is welcome.

Sure! See my comments alongside with your code.


>  0300   BSET 1,000A   ;SET bit 1 of memory 000A
                       ;I am not sure of the function of register 0A
                       ;because I do not have its data.
                       ;On the 68HC05P3 the bit 4 is the KSF
                       ;(keyboard Interrupt status flag).

>  0302   LDA  #1
>  0304   STA  0004     ;Set bit 0 of DDRA (data direction of portA) to output
                       ;the rests are inputs

>         LDA #0FF
>         STA  00E0     ;register EO = 0xFF

>         CLRX          ;index = 0, X is the index register of 6805 (same
                       ;function as FSR in PIC)

>         BSET 0,0000   ;Set bit 0 of PORTA (was set to output above)

>         CLI           ;Clear interrupt mask (enable interrupts).

>         WAIT          ;Sleep.
                       ;All process stopped except interrupts

;This routine may be an interrupt service routine due to the WAIT above.
{Quote hidden}

ROM location 200 (for table read) is not present in the code. It is
needed to the exact execution and porting of your code.

If you have other questions regarding my comments just email me
directly.

I think it is fairly easy to translate the code because it doesn't use
any special/specific controller functions of the Motorola MCU.


Reggie

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...