output_low(CS);
spi_write(0x5F06); // SELECT '2' REG BANK
//output_high(CS);
//delay_ms(10);
//output_low(CS);
spi_write(0x5410); // WRITE 'x10' to 14 REG of 2 BANK to point to the 'led config reg'
//output_high(CS);
//delay_ms(10);
//output_low(CS);
spi_write(0x563B); // WRITE UPPER BIT VALUE
//output_high(CS);
//delay_ms(10);
//output_low(CS);
spi_write(0x57A0); // WRITE LOWER BIT VALUE
output_high(CS);
//spi_write(0x214DD0); //write 0x80 to SPI device
}
Code has no effect ;/
Leds are off all the time.
What am I doing wrong?
Ttelmah Guest
Posted: Sun Jan 17, 2010 3:02 pm
What size value does spi_write take.
What size value are you giving it.....
Best Wishes
lam Guest
Posted: Sun Jan 17, 2010 4:04 pm
Quote:
What size value does spi_write take.
I have no idea.
As is in the Datasheet of ENC.
Im writing for example spi_write(0x5F06);
to point to the 2'nd bank by writing to the ECON1 register.
spi_write(0x5F06); is equal of
bin (010 11111 00000110)
010 mean that we will Write Control Register
11111 is pointer to the register (in this case ECON1)
00000110 is new value to be written into register.
So im sending 2 bytes.
-------
Is there anyone who work with ENC and is able to give me clear answer ? [;
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum