Going back through the software, I soon realised what my mistake or mistakes were. I knew that to write to the different ports using the visual basics you need different addresses. The addresses weren't the problem. The problems were when writing to the control port bit numbers, some of the pins hardware were inverted and I didn't take that into account, therefore I was sending out the wrong signals. Also, I didn't take into account that when I'm writing to a different bit number on the control port that I didn't reset a previous bit number that I had set. Going by this bases, most of my control port settings seemed to be wrong, so I went about correcting them.
Unfortunately, this wasn't as easy as I thought. Parts of the software were being ANDed and ORed and I was trying to keep an account of what bits were already set and what bits weren't. It didn't help that some pins were inverted. Overall I got caught up in the whole affair and began confusing myself. Frustration sank in and after several attempts of chopping and changing the software, then testing it with the hardware, none of them worked properly. I was getting some response from the software, buy not what I wanted. Some switches would work when others wouldn't.
After several attempts I took a breather from the software. At least I knew this week that it wasn't the hardware at fault. So as I took a break from the software and I mounted the hardware together(pic 1). Next week is the final lab, I'll have another crack at the software again and hopefully get it working and have everything completed.
Pic 1) Mounted hardware |
No comments:
Post a Comment