Deadlocks, when one lock is blocking another lock from being released. Convoying, when a thread that holds the lock is paused, all other threads are stuck waiting. Priority, when a low priority process holds a lock that a high priority process needs there is no easy way of telling it to let go. OK, I’ve done enough advertisement.Thread synchronization is the act of notifying all executing code of the latest information regarding the resources they need, locks are there just to make it easy. This makes it more appealing than other low-cost alternatives like PL2303 and CP2102. Another nice thing about CH340 is that it comes with SOIC-16 packaging, which is very easy to solder even by hand. That compared to 30 cents for CH340? You tell me. But there is an economic reason to go for it: even at volume quantity like 1000, FT232 costs about $3 to $4 per chip. You may be wondering: wait a minute, what about the FT232 chip, which has been available on the standard Arduino since the beginning? Isn’t what I am trying to do here already done? Sure, CH340 is basically a replacement for FT232 - both are USB-serial converters. Windows XP and Mac OS still require driver for it, though, but that’s light years better than installing driver for Windows 8. The fact that it doesn’t require driver just makes it a whole lot easier to upgrade firmware. What? Is that even possible? Yup, I’ve verified it - Windows 7, 8 and 8.1 all recognized it right away. What I like the most about this chip though, is that it does not require driver for Windows 7, 8 and above. With this chip, you can now use the standard serial monitor to debug your program, and the bootloader can also now use the standard Arduino bootloader. It’s really inexpensive (less than 30 cents) and requires very few peripheral elements (just a crystal and filter caps). It’s basically a USB-serial chip that is often found in low-cost USB-serial cables / converters. That’s an evidence of how unnecessarily complicated it is!Īnyways, I set out to find a better solution, and was glad that I discovered the CH340 chip. I recently made a video to demonstrate how to update OpenSprinkler firmware - in this 11-minute video, 6 minutes were spent purely on explaining how to install USBasp driver for Windows 8. I’ve often received comments about how it’s painful to install USBasp driver for Windows 8. This step turns out to be unnecessarily complicated. The only way around the issue is to boot Windows 8 into a mode that disables driver signature enforcement. Let’s be honest, for open-source developers, who wants to pay the big bucks to get the driver signed? So suddenly this has created an even bigger barrier for average users. It basically means the driver needs to be digitally signed with Microsoft, otherwise it won’t allow you to install the driver. That is until when Windows 8 came out, with this feature called driver signature enforcement. This was not the most pleasant thing to do, but wasn’t a big deal as the driver was fairly easy to install. The only caveat is that to use USBasp in Windows, you need to install the open-source USBasp driver. This is quite appealing because no extra chip is required, and the programming speed is considerably faster. Instead, I decided to implement a USBasp bootloader for ATmega644, which can present the MCU itself as a USBasp programmer when a button is pressed on start-up. So when I designed OpenSprinkler 2.1, I made the conscious decision to get rid of ATtiny45. This is not an ideal design because it involves an extra chip that we have to program also USBtinyISP is not particularly fast. Back in OpenSprinkler 2.0, I used to have a separate ATtiny45 chip on board to function as a USBtinyISP programmer, which can reflash the main MCU (ATmega644). To understand the background, all of these have to do with firmware upgrade - how to reflash the microcontroller with new firmwares. The second change above is mainly to solve the issue that it has been increasingly painful to install USBasp driver on Windows 8+. The first change above is to increase the processing speed and hopefully make the controller faster at handling complex algorithms and transferring data with the Ethernet controller.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |