Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

datfile 89C51

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-8051
View previous topic :: View next topic  
Author Message
wimneels

Bascom Member



Joined: 23 Mar 2006
Posts: 27

belgium.gif
PostPosted: Thu May 29, 2008 4:39 pm    Post subject: datfile 89C51 Reply with quote

hallo all
wat datfile must I use for de old 40pins AT89C51 24pc? i ame confused !
thanks
Back to top
View user's profile
Aristar

Bascom Member



Joined: 13 Sep 2008
Posts: 7

iran.gif
PostPosted: Sat Sep 13, 2008 10:28 am    Post subject: Reply with quote

You can use Reg51.dat
or for AT89C52 : 8052.dat

----------------------------
you can see any dat file in root directory of bascom-8051

best regards
Back to top
View user's profile
SET

Bascom Member



Joined: 18 Feb 2008
Posts: 2

belarus.gif
PostPosted: Mon Apr 02, 2012 8:31 pm    Post subject: Reply with quote

Hi
Which DAT should be used a file with AT89C51-20PI (89c51cc.dat; 89C51RC.dat; 89C51RD.dat)
Back to top
View user's profile
erg322

Bascom Member



Joined: 12 Dec 2013
Posts: 4
Location: South-East

australia.gif
PostPosted: Thu Dec 12, 2013 9:05 am    Post subject: datfile 89C51 Reply with quote

I'm in the same situation with using Bascom-8051 Demo version.

I bought 3 AT89S52's off the back of a truck(cheap on Ebay) and there is no ".DAT" file...well in the Demo version anyway. I just used 8052.DAT

Am I going to get into hot water if I hack the 8052.DAT into a 89S52.DAT file ??.

_________________
Smile
Back to top
View user's profile AIM Address Yahoo Messenger MSN Messenger
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Thu Dec 12, 2013 3:30 pm    Post subject: Reply with quote

I will write a small guide and post it later how you can solve this.
_________________
Mark
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Thu Dec 12, 2013 3:56 pm    Post subject: Reply with quote

Here is my short guide :

How to create a DAT file for you micro when there is none supplied.

- first step is to get a datasheet of your micro
- in the simple guide i downloaded the AT89S52 datasheet from Atmel
- next step is to get an existing DAT file that is close to the new one.
- i chose the 89S8252.DAT file and made a copy of it
copy 89S8252.DAT 89S52.DAT
- then open the new file in notepad
- before each SFR name, add a space so it will look like this:

Code:
[BIT]
 ACC = E0 , 00
 B = F0 , 00
 IE = A8 , 00
 IP = B8 , 00
 P0 = 80 , FF
 P1 = 90 , FF
 P2 = A0 , FF
 P3 = B0 , FF
 PSW = D0 , 00
 SCON = 98 , 00
 TCON = 88 , 00
 T2CON = C8 , 00

[BYTE]
 SP = 81 , 07
 DPL = 82 , 00
etc.
 

- in the PDF look up the SFR map. These are all the register names with their address
- in the DAT file you will find this [BIT] section
This section contains all bit addressable SFR registers. They all end with address 0 or 8.
- The [BYTE] sections contains all other SFR's

- Now start with the first register from the SFR map from the datasheet. This is B at address F0.
Look up if it exists. And check the address. You will find a number of SFR's always at the same address.

- The value after B in the DAT file is the default or reset value. You could include it as well.
It is only used by the simulator.
- Now remove the space for the handled register. So it looks like :
Code:
[BIT]
 ACC = E0 , 00
B = F0 , 00
 

- and contine with the next one. This is ACC
- continue until you get a register that is not in the DAT file yet. In thius case it is AUXR1.
- Just look at the address and add it to [BIT] or [BYTE] section.
In our case it is the BYTE section:
AUXR1=A2

- when done you will find a few untouched registers.
WMCON = 96 , 02
SPSR = AA , 00
SPCR = D5 , 04
SPDR = 86 , 00

you need to remove them since these are not in the processor!
- now all registers are done. We continue with the [MISC] section.
- first add all interrupts that are available above the timer1 interrupt.
All 8031/8051 interrupts are suppored by default, but 8032/8052 and other interrupts which start at 2B and up you need to add.
In this case, there is onyl TIMER2 interrupt and it is already in the dat file.

- then you could change the name of the up. But the name is used to determine functionality. If you use a DAT file that is close to
the new chip, it is best to leave the name as is.
- then check the IRAM. you find the amount in the PDF as well. And the maximum value is 256 bytes.
If the datasheet says it has 1K internal memory, it is kind of a trick : 256 bytes is the maximum, no exceptions!
The additional memory could be XRAM memory. Often you need to set some AUXilary flag for that.
- last is the clockdiv. Normal 8051 have an internal 12 divider. This means that a 12 MHz xtal will result in a 1 MHz clock.
- some 8051 variants have a 1 divider.
- save your file and create a simple test program.

I also included the new file.

_________________
Mark
Back to top
View user's profile Visit poster's website
erg322

Bascom Member



Joined: 12 Dec 2013
Posts: 4
Location: South-East

australia.gif
PostPosted: Fri Dec 13, 2013 3:09 am    Post subject: Reply with quote

Many thanks for the tutorial and file.
_________________
Smile
Back to top
View user's profile AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-8051 All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum