AnsweredAssumed Answered

How to adjust the MCS-52 BASIC interpreter to ADuC841/2/3

Question asked by Alexandergb on Feb 27, 2012
Latest reply on Jun 21, 2013 by Alexandergb

Hi, gentleman!

 

I would like to fit MCS-52 basic version 1.1 (or later, for exemple v1.3) to ADuC84x device.

Theoretically it is possible because this BASIC interpreter demands at least 8K code ROM and as minimal 1K XRAM

and can operate without external EPROM for initial adjustment and basic program storage.

I tried to modify ASM codes of original BASIC as following^

1) at the address 0000H  I made   LCALL      ADUC842

further


ORG4300H

ADUC842:


MOVPLLCON,#01H;8388608 HZ

MOVCFG842,#01H;XRAM ENABLED

CLRA

MOVDPTR,#0000H;XRAM(0H)=0H

MOVX@DPTR,A

 

 


LJMPCRST
;START

 

2)

I rewrote a procedure of automatic baud rate calculation and load RCAPH2 and RCAPL2 with required constants.

 

When I tried to run the 842 with this codes I find out the incorrect operation of BASIC interpreter.

For instance it does not store user program in RAM

>10 print 10

>list

READY

>

It calculates arithmetic expressions incorrectly or detects errors where are no them.

 

Q: What SFRs can affect on code execution?

Q: Are there any differences in instructions execution on ADuC842 vs standard 8052 and how to work around them?

 

Attachment: modified ASM source of MCS-52 BASIC.

(I suppose one-cycle core of ADuC842 does not affect on calculations).

Attachments

Outcomes