+ Post New Thread
Results 1 to 8 of 8
  1. #1
    Advanced Member level 1
    Points: 5,813, Level: 18
    Maverickmax's Avatar
    Join Date
    Dec 2004
    Posts
    404
    Helped
    8 / 8
    Points
    5,813
    Level
    18

    at89c51 internal

    Hi

    I know I should have looked into datasheet but I am kind of hurry at the moment so does anyone know how many internal registers does AT89C51/AT89C52? What is the device address (default) for AT89C51 and AT89C52? Can I make my own device address??

    The reason for this request is Im in the process of learning to implement I2C method therefore I need to be familiar with the internal registers and default address before conducting further work.

    Thank in advance

    Maverickmax

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 3
    Points: 12,871, Level: 27
    silvio's Avatar
    Join Date
    Dec 2001
    Location
    Romania
    Posts
    716
    Helped
    110 / 110
    Points
    12,871
    Level
    27

    registers of at89c51

    Hi maverick,

    AT89C51 and AT89C52 has no hardware support (special registers) by default for I2C bus.
    If you want to use these microcontroller for I2C implementation you have to do a what is called "bit bang" procedure.
    For learning about I2C you can look here:
    http://neptune.lisa.univ-paris12.fr/...onik/F_I2C.htm



    •   AltAdvertisement

        
       

  3. #3
    Advanced Member level 1
    Points: 5,813, Level: 18
    Maverickmax's Avatar
    Join Date
    Dec 2004
    Posts
    404
    Helped
    8 / 8
    Points
    5,813
    Level
    18

    at89c51 register

    Silivo

    Oh I see

    I will look 'Bit-bangs' up now. Do you know any ATMEL microcontroller has I2C (device address and internal address)?

    Btw thank you for letting me know

    Maverickmax

    Added after 2 hours 20 minutes:

    Hi

    I am kind of familiar with bit-banging approach but the question is should I create my own device addresses in my prototupe function code for multi-slaves?

    Im a bit confused atm

    Maverickmax



    •   AltAdvertisement

        
       

  4. #4
    Full Member level 1
    Points: 1,911, Level: 10

    Join Date
    Feb 2005
    Posts
    107
    Helped
    9 / 9
    Points
    1,911
    Level
    10

    register at89c51

    if you want ATMEL for I2C implementation please open link this site from ATMEL aplication note:

    http://www.atmel.com/dyn/resources/p...ts/DOC0593.PDF
    http://www.atmel.com/dyn/resources/p...s/AEXPDCTL.EXE



  5. #5
    Advanced Member level 1
    Points: 5,813, Level: 18
    Maverickmax's Avatar
    Join Date
    Dec 2004
    Posts
    404
    Helped
    8 / 8
    Points
    5,813
    Level
    18

    from 89c2051 lookbit

    Thank you

    Can anyone ask answer my question about making my own device address?

    Let say I have have two slaves and I selected them to be 0xA1 and 0xB1 respectively in my prototype function in my software. Is it ok or not?

    Maverickmax



  6. #6
    Advanced Member level 3
    Points: 12,871, Level: 27
    silvio's Avatar
    Join Date
    Dec 2001
    Location
    Romania
    Posts
    716
    Helped
    110 / 110
    Points
    12,871
    Level
    27

    at89c51 register pdf

    Hi maverickmax,

    So you want a slave with address 10100001 and one with address 10110001

    Yes, it's OK for read them.
    For write you must have 0xA0 and 0xB0 as slave address.

    Inside the site mentioned before in my previous post you can read:

    Each byte consists of 8 bits. The 8th bit in the SLAVE address has a special meaning. When it is set to 0 it means you want to write to your SLAVE. When it is set to 1 it means that you you want to READ. You could see this as follow. The Even addresses are WRITE addresses, the ODD addresses are READ addresses. Each device has a consecutive WRITE and READ address.


    Example: a PCF8574 General purpose 8 BIT I/O port.
    SLAVE address to WRITE is (01000000)b = 64d
    SLAVE address to READ is (01000001)b = 65d


    So you can have a theoretical maximum of 128 device on you BUS. Practically this is not the case. There have been set up a couple of addresses which you are not allowed to use. There are some that have been reserved by PHILIPS for special purposes.


    ADDRESS R/W

    0000 000 0 : general call address
    0000 000 1 : start byte

    0000 001 x : CBUS address
    0000 010 x : address reserved for different bus format.

    0000 011 x |
    0000 100 x |
    0000 101 x |} to be defined
    0000 110 x |
    0000 111 x |

    This implements that all addresses below 16 are reserved for special purposes

    However bear in mind that an I2C peripheral address is composed of two parts. The fixed part is defined by the I2C bus committee and is assigned based on device type. Thus be carefully do not use such kind of device in your system. Otherwise you can get in conflict with them since they have the slave address hardware configured on the chip.


    1 members found this post helpful.

  7. #7
    Advanced Member level 1
    Points: 5,813, Level: 18
    Maverickmax's Avatar
    Join Date
    Dec 2004
    Posts
    404
    Helped
    8 / 8
    Points
    5,813
    Level
    18

    at89c52 register

    Hi Slivio

    Thank you for clarifying everything.

    I can program the slave to carry the device address. Hence the master will transmit the device address in to alert the slaves. For example the first slave compare its device address with the transmission of device address from master, and if it recognise the device address, it will be ready to listen for further instruction from the master while 2nd slave ignore.

    Am i right?

    I am soz if Im a pain in the ass! I am a terribly slow learner!!!

    Maverickmax



    •   AltAdvertisement

        
       

  8. #8
    Advanced Member level 3
    Points: 12,871, Level: 27
    silvio's Avatar
    Join Date
    Dec 2001
    Location
    Romania
    Posts
    716
    Helped
    110 / 110
    Points
    12,871
    Level
    27

    Re: Internal register and default address of AT89C51 and AT8

    Quote Originally Posted by Maverickmax
    For example the first slave compare its device address with the transmission of device address from master, and if it recognise the device address, it will be ready to listen for further instruction from the master while 2nd slave ignore.

    Am i right?
    YES. That's the point.

    Quote Originally Posted by Maverickmax
    I am soz if Im a pain in the ass! I am a terribly slow learner!!!
    Well, you can't drive a car like one among race team.

    Quote Originally Posted by Maverickmax
    I know I should have looked into datasheet but I am kind of hurry at the moment
    But ever don't rush.



--[[ ]]--