Igor-Plug USB

IgorPlug is an USB-Software-Slave for AT90S2313, ATMega8 or others build by Ing. Igor Cesko.

The Author:

About IgorPlug:

I’ve tried the IgorPlug USB-RS232 Converter on an ATMega8 running with 12MHz for better USB Timing. As reference I used the information on Igor’s Homepage and the Application Note from ATMEL.

Features:

  • 800 Byte FIFO Buffer
  • Baudrates from 300 to 115200
  • Databits: 5,6,7,8; Stopbits: 1,2; Parity: none, even, odd, mark, space
  • Three 8-bit I/O Ports
  • Direct Interface to internal EEProm
  • eventually possibility to use ATmega8 peripherals (not yet implemented)
  • Possibility to add own function

See my IgorPlug:

Igor-Plug USB
Igor-Plug USB 2

Just connected everything on the fly and IT WAS WORKING! I plugged in the USB Cable to my WinXP Computer and it detected the IgorPlug Device. Next i started to write my own userfunction.

Step1:

I wrote a function that should be able to switch on and off the red LED you can see on the pictures.

DoUserFunction3:
lds temp0,InputBufferBegin+4 ;first parameter Lo into temp0
;lds temp1,InputBufferBegin+5 ;first parameter Hi into temp1
;lds temp2,InputBufferBegin+6 ;second parameter Lo into temp2
;lds temp3,InputBufferBegin+7 ;second parameter Hi into temp3
;lds ACC,InputBufferBegin+8 ;number of requested bytes from USB host (computer) into ACC

;Here add your own code:

out PORTC,temp0

mov ZL,temp0 ;will be sending value of RAM - from address stored in temp0 (first parameter Lo of function)
mov ZH,temp1 ;will be sending value of RAM - from address stored in temp1 (first parameter Hi of function)
inc RAMread ;RAMread=1 - reading from RAM
ldi temp0,255 ;send max number of bytes - 255 bytes are maximum
rjmp ComposeEndXXXDescriptor ;a prepare data

Add the Userfunction above line 1218:

;—————— END: This is template how to write own function —————-

To tell IgorPlug to call the function go to line: 1159 where it looks like:

NoDoUserFunction0:
cpi temp1,USER_FNC_NUMBER+1 ;
brne NoDoUserFunction1
rjmp DoUserFunction1 ;execute of user function1
NoDoUserFunction1:
cpi temp1,USER_FNC_NUMBER+2 ;
brne NoDoUserFunction2
rjmp DoUserFunction2 ;execute of user function1
NoDoUserFunction2:

rjmp ZeroDATA1Answer ;if that it was something unknown, then prepare zero answer

And change it to:

NoDoUserFunction0:
cpi temp1,USER_FNC_NUMBER+1 ;
brne NoDoUserFunction1
rjmp DoUserFunction1 ;execute of user function1
NoDoUserFunction1:
cpi temp1,USER_FNC_NUMBER+2 ;
brne NoDoUserFunction2
rjmp DoUserFunction2 ;execute of user function1
NoDoUserFunction2:
cpi temp1,USER_FNC_NUMBER+3 ;
brne NoDoUserFunction3
rjmp DoUserFunction3 ;execute of user function1
NoDoUserFunction3:

rjmp ZeroDATA1Answer ;if that it was something unknown, then prepare zero answer

Step2:

To get access to the Userfunction i had to manipulate the IgorPlug DLL. Because of my poor Delphi knowledge i “copy and paste” an other function and changed the function adress.

Step3:

Igor provides the declaration of his DLL for VB. To get them working with VB.NET i had to modify them and to add my UserFunction.

Step4:

Now i was able to use IgorPlug + my own Function from VB.NET! GREAT

Tags: ,

One Response to “Igor-Plug USB”

  1. Daniel Morales ECUADOR Says:

    Hello, I’m trying to receive information from an GPS, and my problem is that I could not make Igor’s DLL work in VB, so please could you help me with an example on how to use that DLL on VB6 or VB.NET

Leave a Reply