Whew!

No posts over the weekends as a general rule; due to “social commitments” I’m out of the house and unable to either work on any projects.

Still working very slowly to get the MyUSB library working. It’s a very tall order I’ve come to realize; even with an AVR with a dedicated USB controller, the method of establishing proper USB communications is a long and complicated one. I understand the top-level theory I believe, I just need to go over the documentation and Atmel’s driver (yes, I’ve caved somewhat on that point, however I’ve come to realise it’s about the only way it’ll get written) and knuckle down.

Atmel’s driver isn’t too bad, it’s just too complicated for my liking – designed for many different modes and many different compilers. I like being able to write things myself, as I gain understanding in its workings and control over its structure. So what if the end-result is near-identical to Atmel’s – it’s the process and knowedge gained that counts!

I’ve made more scheduler adjustments, expanding the tick counter to 16-bits and fixing up the delay logic. Now with a timer increasing the tick counter every 1mS, I can have two tasks running in the demo app; one showing the status of the joystick/HWB of the USBKey on the bi-colour LEDs, and another monitoring the VBUS. Once proper USB communication is established (a long way away, sadly, as the VBUS register bit seems to only be set once the USB device is enumerated and connected to the host when acting as a device) the second monitoring task disables the first and starts alternativley flashing the bicolour LEDs red and green.

Actually, the scheduler’s been pretty fun to write despite its simplicity. Even with only basic run/stop control and delays, I can write “tasks” in the round-robbin that can start or stop other task(s) – the simple code allows for multiple tasks to shared IDs and thus be controlled as a group – as well as only execute after a fixed number of ticks, or stop executing after a fixed number of ticks. It’s looking more and more likely like I’ll start branching out and researching RTOS kernels so I can design and create my own.

Oh, and please comment if you find and entry interesting/boring. Once I have a feel for what people like to read about, I’ll try to write more entries in those categories.

 

Comments

No comments so far.

Leave a Reply

 
(will not be published)
 
 
Comment
 
 

 

Vital Stats

  • 35 Years Old
  • Australian
  • Lover of embedded systems
  • Firmware engineer
  • Self-Proclaimed Geek

Latest Blog Posts

RSS