2016年6月26日 星期日

Host interface

There are many ways to display data to end users. The first one is to show data on a 7'' LCD panel for BBB, the second one is to pass the data to a PC and display the data on computer screen. I chose the second for my bad eyesight.
Few articles back I mentioned about Qt and network, now, I combine all the previous results together to display the final outcome. The data acquisition procedures are:

  1. Qt program sends operation mode command to BBB through UDP. 
  2. Convert audio data by WM8731 ADC then save to SRAM through FPGA.
  3. Once SRAM is full, FPGA generates a hardware interrupt to AM335X. 
  4. AM335X starts reading data from SRAM through GPMC. 
  5. When reading is done, AM335X starts sending data to PC through UDP. 
  6. Qt program captures and displays the received data. 
The final Qt program is shown below.


2016年6月10日 星期五

9 Axis sensor system

I found a 9-Axis sensor module few months ago when I was moving and packing up my stuff. I used the module on my Cortex-M3 STM32 MCU development board Now I am thinking to plug the module to my BBB and turn my BBB to a sensor system board. 
Here is the main features of the my sensor module:
  • Analog Device ADX345 3-Axis accelerate-meter sensor
  • ST L3G4200 3-Axis angular velocity sensor
  • HoneyWell HMC5843 3-Axis magnetic field sensor
  • BOSH BMP085 pressure sensor 
All the sensors on this modules implements I2C interface, what I need to do for my BBB is to find a 3.3V power for the module and turn on the I2C interface on Linux. The I2C addresses of above sensors are 0x53, 0x69, 0x1E and 0x77 respectively. I pick up I2C-2 on BBB for no obvious reason, I2C-1 should be find as well. I2C-2 is pin 19/20 on BBB header 9. 

Communication with Qt

For days, I had been working on how to establish communication between BBB and my Windows PC through Ethernet, I had little experience programming a PC side software, after scratching my head and surfing through the Internet, I pick up Qt for its rich resources. I planed to have a thread in Qt to wait for incoming data from BBB, but I realized the way Qt uses a terminology called "signal and slot"; a simple way to put this is "a incoming signal trigger the slot to do a task".
Here is the example of how Qt link incoming Ethernet signal to a function, "readyRead" is the incoming signal while rxPacket is the function to process the UDP packet when triggered.
connect(udpSocket, SIGNAL(readyRead()), this, SLOT(rxPacket()));
Below is the snap of my Qt data acquisition interface, I will explain the functions of program later.