pátek 13. února 2015

ENC28J60 library for Due

After sorting out the priorities and deciding on features, I found out that the ENC28J60 ethernet chip will be connected over software SPI.  I don't expect any heavy traffic, and anyway, the software SPI on Arm shoudn't be that bad (it turned out I can get to something like 1MHz, which isn't bad at all). Modifying the library for the soft SPI wasn't that difficult, but the debugging was.
It did not work, no ping, nothing. I wasn't surprised, as I expected a few packed structure and endianity problems. First thing I wanted was to check if the soft SPI implementation works correctly. I took the Saleae logic analyzer, hooked it to the SPI bus, and captured the communication. All looks fine, the values make sense, and they're same as the values the code actually tries to write to the chip. I was a bit puzzled by the fact the chip does not send any meaningful output, the MISO line stays at the same level all the time. However, after capturing some more, I actually noticed that later on, the chip sends some data via MISO line.
All looks good, but still, there's no ping, no matter what. As a next step, I'll add some code to read something from the chip, preferrably a known value, like stepping or something to make sure that reading also works.
When looking for some details on the web, I found out that the same guy who wrote the UIPEthernet library I am using also wrote the Due port of it. That one still uses the HW SPI, but could help when it comes to those problems when migrating 8bit to 32bit code.
Completely different topic. My telescope arrived yesterday, but so far the sky wasn't clear and I had no chance to test it, hopefully over the weekend. It's a very cheap and basic telescope and I don't expect miracles, but hopefully it will help me to identify the planet I am seeing every evening from my window.
The other thing that arrived yesterday are the fuse holders that I am planning to use as holders for the SBM-20 GM tube. If my wife's computer behaves and won't demand my attention, I could have quite interesting weekend!

Žádné komentáře: