Monday, July 27, 2009

PHPhD – Server side hardware port access extension for PHP

In one of my project I need to access PC hardware ports using PHP. Standard distribution of PHP (PHP for Windows) may not have facilities to access PC/Server hardware ports, and finally I developed lightweight PHP extension to access server hardware ports.

Current version of PHPhD (version 1.0.0.20) support for PHP 5.2.x (tested with PHP 5.2.1) and distributed under the terms and conditions of Mozilla Public License version 1.1. This PHP extension is available to download at http://elect.wikispaces.com/Downloads

Using PHPhD users can access server hardware ports with minimum amount of coding and complexity. Example PHP source code which was based on PHPhD is listed in below,


//Initialize and open hardware device driver
if(!phphd_open_driver()) {
die("Unable to open PHP hardware port access device driver");
}

//read printer (LPT) port and get the curent port value
$lpt_port_val = phphd_read_port(0x378+1);
echo("LPT port value [0x378+1] : ".
$lpt_port_val);

//close device driver
phphd_close_driver();
?>

Current version of PHPhD (version 1.0.0.20) has following functions,

  • phphd_open_driver : Function to load device driver and initialize the hardware access session.
  • phphd_close_driver : Function to close current device driver and release all the hardware sessions.
  • phphd_isopen : Function to get the initialization status of the device driver.
  • phphd_read_port : Read specified hardware port and return the value.
  • phphd_write_port : Function to write value to the specified hardware port.
  • phphd_sound : Function to trigger the system (server) speaker with given frequency and period. Most of the times we use this function to test the device driver and functionality of PHPhD.

Please note that this PHP extension is available for the Windows platforms only.

Thursday, July 23, 2009

Low Cost and High Quality Stereo FM Radio Receiver

In this project we build CXA1619BS base high performance FM stereo radio receiver using low cost and readily available electronic components. In this design we use CXA1619 as FM radio receiver and BA1320 as FM stereo decoder and LA4108 as power amplifier.


When building the circuit it is highly recommended to build it using the print circuit board (PCB) and take some necessary steps to reduce the effects of external interferences.

In this design we use BA1320 as stereo decode and user can also use BA1330 with this circuit with some less amount of input voltage. (For example: +5V) We use BA1320 for this design because of its low cost, low complexity, higher channel separation and higher availability.

In current design we use LA4108 as power amplifier and it delivers 6W x 2 output power at 8ohm load.

While assembling the circuit make sure to apply suitable heat-sinks to both 7805 voltage regulator and LA4108 power amplifier.

At the testing stages this circuit produces excellent results and fewer amounts of issues in tuning. Anyone can tune this circuit without using signal generator and oscilloscope.

It is recommended to provide 7V to 12V of supply voltage to this circuit and at the testing stages we use 8.0V PSU with this circuit.

Circuit diagram and assembling notes of this circuit is available in http://elect.wikispaces.com.