Hello,
I'm working with the SJA1110 Ethernet switch and I'm currently facing issues establishing a link. I'm attempting to configure everything via SPI, without using the SDK.
So far, I've used the following initialization sequence:
SJA1110AEL_write_word(VM_DAC_CONTROL0, 0x107B);
SJA1110AEL_write_word(POWER_DOWN_CONTROL, 0x0060);
SJA1110AEL_write_word(VM_DAC_CONTROL0, 0x907B);
uint32_t trim_val = SJA1110AEL_read_word(SHADOW1_27); // SHADOW1_27 = 0
trim_val = (trim_val >> 16) & 0x3;
SJA1110AEL_write_word(CBTX_TRIM_CONFIG, trim_val);
SJA1110AEL_write_word(BASIC_CONTROL_REGISTER, 0x8000);
uint32_t timeout = 1000000;
while ((((SJA1110AEL_read_word(BASIC_CONTROL_REGISTER) >> 15) & 0x1) && --timeout);
if (timeout == 0) {
return false; // Reset failed
}
SJA1110AEL_write_word(BASIC_CONTROL_REGISTER, 0x3100);
SJA1110AEL_write_word(CBTX_AFE_SPARE_REG, 0x0002);
With this configuration, I noticed that there is no activity in the link bit of the BASIC_STATUS register.
While searching for a solution, I found the following sequence on a forum:
Register Name R/W Value Comment
| 0x60h | POWER_DOWN_CONTROL | W | 0x60h | Disable True Power Down Mode |
| 0x00h | BASIC_CONTROL_REGISTER | W | 0x8000h | Soft Reset |
| 0x00h | (same as above) | R | Wait while bit15 == 1 | Wait until reset is done |
| 0x70h | SPECIAL_INTERNAL_TEST_CONTROLS | W | 0x1600h | Disable DSP/AFE register reset |
| 0x44h | MODE_CONTROL_STATUS | W | 0x40h | Disable Auto-MDIX, force MDIX mode |
| 0x00h | BASIC_CONTROL_REGISTER | W | 0x2100h | 100 Mbps, Full Duplex |
Using this configuration, the link bit is set to 1, but only briefly—it drops back to 0 after a couple of seconds. I'm somewhat skeptical of this approach, especially since the SPECIAL_INTERNAL_TEST_CONTROLS register modifies bits that aren't documented in the datasheet.
Is there an officially supported way to configure the switch without the SDK? If not, I missing a step to make link?
Any guidance would be greatly appreciated.
Best regards,
Daniel