??? 06/12/12 14:33 Read: times |
#187675 - help me with 93c46 and at89s52---MikroC Responding to: ???'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 !!!!!! |
Topic | Author | Date |
help me with 93c46 and at89s52---MikroC | 01/01/70 00:00 | |
What You Need to Do Yourself | 01/01/70 00:00 | |
need help - 93c46 using AT89s52 - mikroc | 01/01/70 00:00 | |
MikroC is unwise choice | 01/01/70 00:00 | |
help me with 93c46 and at89s52---MikroC | 01/01/70 00:00 | |
So check without scope - adjust code until testable | 01/01/70 00:00 | |
you have now 3 times asked help with 93c46/at89s52--MikroC | 01/01/70 00:00 | |
93c46/at89s52--MikroC | 01/01/70 00:00 | |
my suggestion | 01/01/70 00:00 | |
You have already been given suggestions | 01/01/70 00:00 | |
help me with 93c46 and at89s52---MikroC | 01/01/70 00:00 | |
Use a proper Compiler | 01/01/70 00:00 | |
I wanna, I wanna, I wanna, | 01/01/70 00:00 | |
Time to actually prove your logic and your delays | 01/01/70 00:00 | |
----thanks all for helping out | 01/01/70 00:00 | |
do you REALLY expect .... | 01/01/70 00:00 | |
If you can't get MikroC to work ... | 01/01/70 00:00 | |
switching to keil | 01/01/70 00:00 | |
Example code on this website | 01/01/70 00:00 | |
why, oh why | 01/01/70 00:00 |