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.

C libraries in particular for the Atmel AT89S8252

Status
Not open for further replies.

GrandAlf

Advanced Member level 2
Advanced Member level 2
Joined
Mar 9, 2002
Messages
520
Helped
47
Reputation
92
Reaction score
6
Trophy points
1,298
Location
UK
Activity points
4,730
I would be grateful if anyone can point me in the direction of any C libs in particular for the Atmel AT89S8252.

Looking for sound routines (tones blips, etc) and eeprom read/write subs.

Any pointers much appreciated.
 

Thanks for the link Ilia
 

Thanks maziar, All links are useful
 

Hello GrandAlf,

If you visit the http://www.8052.com,
you can find some useful informations which you need.

Good luck.
:roll:
 

Thanks Cheolim,

I tried this site a while ago, and could not find anything specific. Maybe worth another look?.
 

Hi GrandAlf

First of all, I'm sorry for my information which you already know.
Re. the sound routines I don't have any resource but follows may help you.
Those come from k@il support site.
I hope it useful for you

QUESTION

I was looking for information concerning writing to and reading from the 2K EEPROM space of the AT89LS8252. Does the Keil C language directly support this? Are any examples available?

ANSWER

1. To access AT89S9252's internal EEPROM you must drive a flag in a new special function register called WCON (this register controls both: EEPROM access and Watchdog timer).

2. If you'll only read the internal EEPROM (not write) and your system will NOT have external RAM, then you can access the EEPROM as if it were external RAM by:

a) Intitially configuring the EEMEN bit that is part of the WCON special function register and that switches the access to the internal EEPROM instead of external RAM through MOVX instruction.

b) Generating a BIN file with the data for your EEPROM (the ISP software created by ATMEL to program the AT89s and AT90s allows to write both: code memory and EEPROM memory).

c) Create a const variable (ie a pointer) that points to the address of the EEPROM to access:

Example: The following pointer can be used to read a string starting at address 0x010 of the internal EEPROM of AT89S8252 (note that the pointer is stored in the "data" memory space while it points to the "xdata" memory space and don't forget to set up the EEMEN bit):

data const char * xdata MESSAGE = ((const char *) 0x010);


3. If you want your program to write to the EEPROM or your system will have external RAM, then you'll have to create specific subroutines.
 

Thanks again Cholim,

I kind of get the idea how to do it, but in practice I have problems with eratic data writing. I will try running a simulation, as it may be a timing error.

It would be useful if anyonle else had done this, so I could compare and check my code for errors.
 

Thats Great Thomas, this info is really appreciated. Only just started learning C a short while ago. So any pre written code is a bonus.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top