Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/12/12 08:33
Read: 876 times


 
#187675 - help me with 93c46 and at89s52---MikroC
Responding to: Per Westermark's previous message
respected sirs...

i have tried all....reduced the delay, refered to the datasheet again and again...

but am getting all the time same output...

even i have tried to use SPI in MikroC...which didn't work as well..

i tried to test 24c02 ....i was successful a bit with little problem.

but, here in this case am not getting any of the output..
MikroC compiles the code well,
please find the code using SPI as well--

//define pin
sbit Chip_Select at P3.B3;
sbit SoftSpi_CLK at P3.B2;
sbit SoftSpi_SDI at P3.B1;
sbit SoftSpi_SDO at P3.B0;

unsigned char i;

void EWEN(){
SoftSpi_SDI=1;
SoftSpi_CLK=1;
Chip_Select=1;
Soft_SPI_Write(0b00);
Soft_SPI_Write(0b1100000);
SoftSpi_SDI=0;
Chip_Select=0;
Chip_Select=1;
Chip_Select=0;

}
void ERAL(){
SoftSpi_SDI=1;
SoftSpi_CLK=1;
Chip_Select=1;
Soft_SPI_Write(0b00);
Soft_SPI_Write(0b1000000);
SoftSpi_SDI=0;
Chip_Select=0;
Chip_Select=1;
Chip_Select=0;
}
void WRITE(){
SoftSpi_SDI=1;
SoftSpi_CLK=1;
Chip_Select=1;
Soft_SPI_Write(0b01);
Soft_SPI_Write(0b0000000);
Soft_SPI_Write(0b00101000); // data 0x28H being sent (represents 0 on my kit)
SoftSpi_SDI=0;
if(SoftSpi_SDO==1) Chip_Select=0;
}

unsigned char READ(){
unsigned char dtt=0x00;
SoftSpi_SDI=1;
SoftSpi_CLK=1;
Chip_Select=1;
Soft_SPI_Write(0b10);
dtt=Soft_Spi_Read(0b0000000);
SoftSpi_SDI=0;
Chip_Select=0;
Chip_Select=1;
Chip_Select=0;
return dtt;
}

void main()
{   P3=0;
    Soft_SPI_Init();
    EWEN();
    ERAL();
    WRITE();
    Delay_ms(30);
    P0 = READ(); //display
    while(1)
   {
     for(i=0; i<8; i++)
     {
          P2=0xFE; // 7 segment display selected out of 8 nos.
          
     }
   }
}


 


FYI the result am getting is all the leds glows !!!!!!


List of 20 messages in thread
TopicAuthorDate
help me with 93c46 and at89s52---MikroC      Mandeep Singh      06/03/12 16:29      
   What You Need to Do Yourself        Michael Karas      06/03/12 17:33      
      need help - 93c46 using AT89s52 - mikroc      Mandeep Singh      06/09/12 04:59      
         MikroC is unwise choice      David Prentice      06/09/12 09:34      
   help me with 93c46 and at89s52---MikroC      Mandeep Singh      06/09/12 05:01      
      So check without scope - adjust code until testable      Per Westermark      06/09/12 06:04      
         you have now 3 times asked help with 93c46/at89s52--MikroC      Erik Malund      06/11/12 07:36      
            93c46/at89s52--MikroC      Mandeep Singh      06/11/12 10:36      
               my suggestion      Erik Malund      06/11/12 11:27      
               You have already been given suggestions      Per Westermark      06/11/12 11:55      
                  help me with 93c46 and at89s52---MikroC      Mandeep Singh      06/12/12 08:33      
                     Use a proper Compiler      David Prentice      06/12/12 08:42      
                        I wanna, I wanna, I wanna,      Erik Malund      06/12/12 09:15      
                     Time to actually prove your logic and your delays      Per Westermark      06/12/12 09:21      
                        ----thanks all for helping out      Mandeep Singh      06/12/12 10:54      
                           do you REALLY expect ....      Erik Malund      06/12/12 11:29      
                     If you can't get MikroC to work ...      Richard Erlacher      06/12/12 15:25      
                        switching to keil      Mandeep Singh      06/13/12 14:32      
                           Example code on this website      David Prentice      06/13/12 15:05      
                           why, oh why      Erik Malund      06/13/12 18:06      

Back to Subject List