Skip to main content
added 132 characters in body
Source Link

strong text[![schematic**strong text**][1]][1]ischematic**strong text**i have Vector nav100 IMU sensor that sends data serially UART.I want to receive data from it using ATmega32 and then store data in AT24c1024 EEprom using I2C,then using another ATmega32 to read the saved data on AT24c1024 EEprom using I2C to control a servo motor..so,the AT24c1024 EEprom is then shared between the two microcontrollers...i have serached the internet about how to share one External serial EEprom,i found that......(On way would be for the two mcrocontrollers to have an output line as an input to the other. A master that is "using" the EEPROM perhaps pulls his output low (or high - your choice) to say "I'm using it at the moment". The other reads his input first before going near the EEPROM if he finds the line active he backs off until it is set inactive by the other master.i tried this solution but i failed...can any one help me on this solution ? Thanks in advance...... this is my code {

{

    //the first MCU fristly check the pin
    //if high,then write,then set it low to allow read
    //the second MCU fristly check the pin
    //if low ,then write,then set it high to allow write
    
    //for the MCu that will write
    //first it will check for the pin ,if it is LOW,
    //then it can write data to EEprom
                     DDRA=0x00;//configure portA as input
            if(PINA==0x00)//check for the pin, if LOw,then wirte
    {                            
        byte_write(data);
        _delay_ms(10);
    //After writing set the pin as high to allow the second MCU to read
        DDRA=0xff;//configure portA as output
        PORTA=0xff;//set the pin as high
        _delay_ms(10);}
    
    //for the MCu that will read,i set adelay of 10 ms
    // to allow the first MCU to write some data
    
                         _delay_ms(1000);//delay from the data to be written on the EEprom
                 DDRA=0x00;//configure portA as input
        if(PINA==0x01)//check for the pin, if HIGH,then read
    {
             y=byte_read(data);
            DDRA=0xff;configure portA as output
            PORTA=0x00;//set the pin as high

}

} [1]: https://i.sstatic.net/gmWoA.jpg

strong text[![schematic**strong text**][1]][1]i have Vector nav100 IMU sensor that sends data serially UART.I want to receive data from it using ATmega32 and then store data in AT24c1024 EEprom using I2C,then using another ATmega32 to read the saved data on AT24c1024 EEprom using I2C to control a servo motor..so,the AT24c1024 EEprom is then shared between the two microcontrollers...i have serached the internet about how to share one External serial EEprom,i found that......(On way would be for the two mcrocontrollers to have an output line as an input to the other. A master that is "using" the EEPROM perhaps pulls his output low (or high - your choice) to say "I'm using it at the moment". The other reads his input first before going near the EEPROM if he finds the line active he backs off until it is set inactive by the other master.i tried this solution but i failed...can any one help me on this solution ? Thanks in advance...... this is my code {

//the first MCU fristly check the pin
//if high,then write,then set it low to allow read
//the second MCU fristly check the pin
//if low ,then write,then set it high to allow write

//for the MCu that will write
//first it will check for the pin ,if it is LOW,
//then it can write data to EEprom
                 DDRA=0x00;//configure portA as input
        if(PINA==0x00)//check for the pin, if LOw,then wirte
{                            
    byte_write(data);
    _delay_ms(10);
//After writing set the pin as high to allow the second MCU to read
    DDRA=0xff;//configure portA as output
    PORTA=0xff;//set the pin as high
    _delay_ms(10);}

//for the MCu that will read,i set adelay of 10 ms
// to allow the first MCU to write some data

                     _delay_ms(1000);//delay from the data to be written on the EEprom
             DDRA=0x00;//configure portA as input
    if(PINA==0x01)//check for the pin, if HIGH,then read
{
         y=byte_read(data);
        DDRA=0xff;configure portA as output
        PORTA=0x00;//set the pin as high

} [1]: https://i.sstatic.net/gmWoA.jpg

strong textschematic**strong text**i have Vector nav100 IMU sensor that sends data serially UART.I want to receive data from it using ATmega32 and then store data in AT24c1024 EEprom using I2C,then using another ATmega32 to read the saved data on AT24c1024 EEprom using I2C to control a servo motor..so,the AT24c1024 EEprom is then shared between the two microcontrollers...i have serached the internet about how to share one External serial EEprom,i found that......(On way would be for the two mcrocontrollers to have an output line as an input to the other. A master that is "using" the EEPROM perhaps pulls his output low (or high - your choice) to say "I'm using it at the moment". The other reads his input first before going near the EEPROM if he finds the line active he backs off until it is set inactive by the other master.i tried this solution but i failed...can any one help me on this solution ? Thanks in advance...... this is my code

{

    //the first MCU fristly check the pin
    //if high,then write,then set it low to allow read
    //the second MCU fristly check the pin
    //if low ,then write,then set it high to allow write
    
    //for the MCu that will write
    //first it will check for the pin ,if it is LOW,
    //then it can write data to EEprom
                     DDRA=0x00;//configure portA as input
            if(PINA==0x00)//check for the pin, if LOw,then wirte
    {                            
        byte_write(data);
        _delay_ms(10);
    //After writing set the pin as high to allow the second MCU to read
        DDRA=0xff;//configure portA as output
        PORTA=0xff;//set the pin as high
        _delay_ms(10);}
    
    //for the MCu that will read,i set adelay of 10 ms
    // to allow the first MCU to write some data
    
                         _delay_ms(1000);//delay from the data to be written on the EEprom
                 DDRA=0x00;//configure portA as input
        if(PINA==0x01)//check for the pin, if HIGH,then read
    {
             y=byte_read(data);
            DDRA=0xff;configure portA as output
            PORTA=0x00;//set the pin as high

}
added 85 characters in body
Source Link

istrong text[![schematic**strong text**][1]][1]i have Vector nav100 IMU sensor that sends data serially UART.I want to receive data from it using ATmega32 and then store data in AT24c1024 EEprom using I2C,then using another ATmega32 to read the saved data on AT24c1024 EEprom using I2C to control a servo motor..so,the AT24c1024 EEprom is then shared between the two microcontrollers...i have serached the internet about how to share one External serial EEprom,i found that......(On way would be for the two mcrocontrollers to have an output line as an input to the other. A master that is "using" the EEPROM perhaps pulls his output low (or high - your choice) to say "I'm using it at the moment". The other reads his input first before going near the EEPROM if he finds the line active he backs off until it is set inactive by the other master.i tried thatthis solution but i failed...can any one help me on this solution or give me another solution? Thanks in advance...... this is my code {

//the first MCU fristly check the pin
//if high,then write,then set it low to allow read
//the second MCU fristly check the pin
//if low ,then write,then set it high to allow write

//for the MCu that will write
//first it will check for the pin ,if it is LOW,
//then it can write data to EEprom
                 DDRA=0x00;//configure portA as input
        if(PINA==0x00)//check for the pin, if LOw,then wirte
{                            
    byte_write(data);
    _delay_ms(10);
//After writing set the pin as high to allow the second MCU to read
    DDRA=0xff;//configure portA as output
    PORTA=0xff;//set the pin as high
    _delay_ms(10);}

//for the MCu that will read,i set adelay of 10 ms
// to allow the first MCU to write some data

                     _delay_ms(1000);//delay from the data to be written on the EEprom
             DDRA=0x00;//configure portA as input
    if(PINA==0x01)//check for the pin, if HIGH,then read
{
         y=byte_read(data);
        DDRA=0xff;configure portA as output
        PORTA=0x00;//set the pin as high

} [1]: https://i.sstatic.net/gmWoA.jpg

i have Vector nav100 IMU sensor that sends data serially UART.I want to receive data from it using ATmega32 and then store data in AT24c1024 EEprom using I2C,then using another ATmega32 to read the saved data on AT24c1024 EEprom using I2C to control a servo motor..so,the AT24c1024 EEprom is then shared between the two microcontrollers...i have serached the internet about how to share one External serial EEprom,i found that......(On way would be for the two mcrocontrollers to have an output line as an input to the other. A master that is "using" the EEPROM perhaps pulls his output low (or high - your choice) to say "I'm using it at the moment". The other reads his input first before going near the EEPROM if he finds the line active he backs off until it is set inactive by the other master.i tried that but i failed...can any one help me on this solution or give me another solution? Thanks in advance......

strong text[![schematic**strong text**][1]][1]i have Vector nav100 IMU sensor that sends data serially UART.I want to receive data from it using ATmega32 and then store data in AT24c1024 EEprom using I2C,then using another ATmega32 to read the saved data on AT24c1024 EEprom using I2C to control a servo motor..so,the AT24c1024 EEprom is then shared between the two microcontrollers...i have serached the internet about how to share one External serial EEprom,i found that......(On way would be for the two mcrocontrollers to have an output line as an input to the other. A master that is "using" the EEPROM perhaps pulls his output low (or high - your choice) to say "I'm using it at the moment". The other reads his input first before going near the EEPROM if he finds the line active he backs off until it is set inactive by the other master.i tried this solution but i failed...can any one help me on this solution ? Thanks in advance...... this is my code {

//the first MCU fristly check the pin
//if high,then write,then set it low to allow read
//the second MCU fristly check the pin
//if low ,then write,then set it high to allow write

//for the MCu that will write
//first it will check for the pin ,if it is LOW,
//then it can write data to EEprom
                 DDRA=0x00;//configure portA as input
        if(PINA==0x00)//check for the pin, if LOw,then wirte
{                            
    byte_write(data);
    _delay_ms(10);
//After writing set the pin as high to allow the second MCU to read
    DDRA=0xff;//configure portA as output
    PORTA=0xff;//set the pin as high
    _delay_ms(10);}

//for the MCu that will read,i set adelay of 10 ms
// to allow the first MCU to write some data

                     _delay_ms(1000);//delay from the data to be written on the EEprom
             DDRA=0x00;//configure portA as input
    if(PINA==0x01)//check for the pin, if HIGH,then read
{
         y=byte_read(data);
        DDRA=0xff;configure portA as output
        PORTA=0x00;//set the pin as high

} [1]: https://i.sstatic.net/gmWoA.jpg

Source Link

about how to share one External serial EEprom using two microcontrollers?

i have Vector nav100 IMU sensor that sends data serially UART.I want to receive data from it using ATmega32 and then store data in AT24c1024 EEprom using I2C,then using another ATmega32 to read the saved data on AT24c1024 EEprom using I2C to control a servo motor..so,the AT24c1024 EEprom is then shared between the two microcontrollers...i have serached the internet about how to share one External serial EEprom,i found that......(On way would be for the two mcrocontrollers to have an output line as an input to the other. A master that is "using" the EEPROM perhaps pulls his output low (or high - your choice) to say "I'm using it at the moment". The other reads his input first before going near the EEPROM if he finds the line active he backs off until it is set inactive by the other master.i tried that but i failed...can any one help me on this solution or give me another solution? Thanks in advance......