Leverage Existing Display Data Channel with I2C Adapter

You’ve been heard about the I2C before? However, do you know the exactly use of it? I2C or Inter-Integrated Circuit is a two-wire serial bus that commonly used in computer for extremely low-level communication. I2C can easily found in the microcontrollers, embedded systems, and industrial computers. DDC is simply an implementation of an I2C bus. The solid reason why you must use I2C because the cost is far cheaper than the Commercial USB to I2C, which can cost up to $100 to $250! DDC is established in four wires: +5VDC, ground, serial data and serial clock, the pin numbers of which will also vary depending on the type of video port used. For a 15-pin VGA cable, the pins function will be:

Continue reading

New WinAVR 20080411 has been released

Open source rocks isn’t it? Here is a new WinAVR 20080411 release available for download. As always new release has lots of tweaks, bug fixes and optimizations. There are new XMEGA series microcontrollers preliminary included in supported device list. So we may have a chance to put hands on these new cool AVR microcontrollers. Here is a list of new things in WinAVR: Support of new AVR devices: ATxmega128A1, ATxmega64A1, ATxmega32M1, ATxmega32C1, ATxmega32U4, ATtiny167; New GCC4.3.0 compiler; New version of AVR-LibC 1.6.2; Two new Makefile templates added where one will generate a library instead of an application (Makefile.lib), while another will enable whole program optimization. This seems to be new thing – it will be interesting to experiment with. New version of SRecord 1.38; New version of SimulAVR 0.1.2.5; Removed AVR-Ada (as they say – temporary)-I don’t need it anyway… Just recompiled my old code – seems to be working fine. So I recommend you to update to newer WinAVR version.

Continue reading

xDRV-driver for LPT with interrupt service routine

Driver xDRV.sys is driver developed by Иванов Д. Ð’.(www.pcports.ru) and is capable to work(read write) with any PC port under windows NT, 2000, XP. But main advantage of this driver is that it can catch and handle LPT port interrupts (in this case LPT1 with address 0x378 with IRQ 07). Program part of xDRV Lets see how this driver can be put in action. First of all download packed archive with driver and library with functions. xDRV.sys <13.2kB> In this package you will find driver xDRV.sys, dynamical library xDRV.dll, statical library xDRV.lib, which may be needed while compiling project with statical connection of dll and header file with function prototype description which can control driver. Let see the functions: bool xDRV_OpenDriver(); Driver xDRV.sys is dynamically loadable. For loading this driver and initializing this function is used. If driver is loaded successfully, then function returns TRUE otherwise FALSE. This function has to be called one time at the beginning. If function returned FALSE then try to restart computer might be xDRV.sys already has been loaded to the memory and function xDRV_StopDriver() wasn’t used. Driver and library has to be placed in same directory where project files are. void xDRV_StopDriver(); As it…

Continue reading

Control LPT port under windows XP using Delphi

Another way of controlling LPT port under Windows 2000 and XP using Delphi language. In this case library inpout32.dll is used which allows controlling LPT port registers. Ready project for Borland Delphi 7.0 you can download here: Project Files<187.5kB> And now how to do this from beginning. Start Borland Delphi 7.0 and make simple form where you can enter Data to be sent to port, Port Address, buttons for writing to and reading from port.   If you are familiar with building forms this should be ease task. OK now lets start programming. First of all wee need somehow to include inpout32.dll in to the project. For this Delphi has several ways, but lets stay to the easiest one when library is in same directory, where project is. Then in header in section uses we have to place function prototypes Out32 and Inp32 with special compiler directive external, saying where to find this finction. uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; function Inp32(PortAdr: word): byte; stdcall; external ‘inpout32.dll’; function Out32(PortAdr: word; Data: byte): byte; stdcall; external ‘inpout32.dll’;   Then lets go to the button methods. For this double click on button in form and you will…

Continue reading

Controlling external devices using COM port communications programmed using VB language

There are a lot of Radio amateurs that want to control external devices using computer standard ports. One of them is COM poert. Everybody wants things to be ease as people doing electronics are more hardware people not software. COM port is more often used than LPT because COM port is more resistive to bigger loads and there is less chances of failing. So if you know Visual Basic a little bit then this shouldn’t be very hard to use MSComm Control component which is located in Project->Components. You should check check box MSComm Control. Later you have to add this control to form and write some code for it. Main difficulty with this is that you have to follow RS232 protocol. This is why it is better to use microcontrollers that have built in USART interface. Of course MSComm component allows to read and control single COM pins and this way to control any external devices without using RS232 protocol. One good example is popular programming software PonyProg (which is programmed in other language than VB, but principals are same). You can see various supported circuits that PonyProg supports and you can see that Rx(2) and Tx(3) signals aren’t…

Continue reading

Sample routine of working with LPT1 port under windows XP in CPP language

This is simple routine of sending and reading of byte from LPT1 port under Windows XP. LPT port has four types of pins: 8 output pins accessed via the DATA Port 5 input pins (one inverted) accessed via the STATUS Port 4 output pins (three inverted) accessed via the CONTROL Port The remaining 8 pins are grounded Now we are interested in Data pins. Set up driver according to post: Acces LPT and COM ports easily under windows NT-2000-XP. I have written and compiled example under DEV-CPP tool-set, which you can download from https://www.bloodshed.net/. Start New console project Create new cpp file and save it to project directory. Also copy porttalk_IOCTL.h and pt_ioctl.c files to project directory. These files you will find in the package portalk22.zip. Test program: Compile this program and run it. You should see results like this: Now it is time to connect your microcontroller and start experimenting. Good luck. Test routine project files for DEV-CPP are here:LPT1 Sample Project

Continue reading

Program LPT and COM ports easily under windows NT-2000-XP

If you are working with embedded projects usually you have concerned about how directly control computer ports like LPT or COM. Basically no one wants to mess up with driver writing or reading tons of documentations in order to send some bytes via IO port to your target board. Earlier when DOS, win95 and win98 operating systems were popular accessing I/O ports was easy as there weren’t any protections – simple code could do the job. Under NT/2000/XP situation is different. These operating systems has strict control of I/O ports. Read more about this here: www.beyondlogic.org. If you will try to access ports directly under windows XP, then you will get error mesage: How to solve this problem without writing your own driver and without rewriting old DOS or win98 programs. Well there is a solution that allow you to run programs under windows 2000/XP and talk to ports directly. Download PortTalk program from www.beyondlogic.org. Now you have two ways of running programs – but don’t forget to read porttalk.pdf which is included in package. Solution No.1 Download portalk22.zip and unzip it in separate folder somewhere. Then copy allowio.exe directly to the directory where is you program which you want…

Continue reading