Wednesday, July 9, 2008

i2c shared library continued

Previously I told you about some problems I encountered with writing my proper library to interface the I/O functionality of the i2c extension board.

- One of the leds didn’t work --> replaced and ok

- One opto coupler not connected --> wire patch and ok

- Unload function called twice --> constructor copy/paste error ok

After that I continued with testing the DAC. It was soon obvious that the levels were not correctly emitted. 3/4 of maximum digital input was already maximum analogue output. I discussed it with my friend who did the hardware and soon he saw an issue in the calculation of R2/R1 for the opamps he forgot the 1. The correct one was:

Vo = 1 + R2/R1

So he had to order some new resitance with 1.65K. Replacement planned for this weekend. I also finished testing my shared library interface now. I covered following :

  1. Writing all banks output PCA
  2. Writing per bank output PCA
  3. Reading all banks input PCA
  4. Reading per bank input PCA
  5. Writing all DAC
  6. Writing individual DAC

Error messages are logged into syslog system because this must be able to run as a daemon without stdin/out. Next thing todo is making a GPIO shared object on the same basis as i2c one. Finally test this out with a small interrupt handler that catches the pca level changes and act appropriate. If that is covered I only need to write one more proof of concept for the playing the wav files. This will be done using linux message queues. Also a little daemon process that sits and wait on new sound demand arrivals. Whenever these things are done, I hope end of this mounth, I finally can start with the real domotic logic.

No comments: