Connect with us

STM32L + ENC28J60-H(Olimex)

Discussion in 'Microcontrollers, Programming and IoT' started by SteAlzzer, Dec 2, 2012.

Scroll to continue with content
  1. SteAlzzer


    Dec 2, 2012
    Hello everybody!
    I've got a problem with connecting ENC28J60-H by Olimex to my STM32L-Discovery.
    So I write the code, that read an ECON1 register, thatn write some value into it and that read it again. And here is a problem: when i use a debugger step-by-step (F10) each line in this code, everything goes well. But when I set a breakpoint after this lines, register returns me 0x00.
    I decided, that ENC just don't have enough time to write values into register. But manual says, that it has its own crystal osillator with frequency 20 or 25 MHz (don't remember exactly). And my frequency is about 150 kHz.
    Anyway, I set a Delay (simple counter in the loop) after each SPI-sending or recieving. And that's helped.
    Then I go ahead. I write an Init-function (soft-reset, than writing needed values into register), use it in main function. After calling it, I read a ECON1 register again. And I all i got is 0x00 again, even with Delays.
    Does anybody know what to do in this situation?
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day