Dear James.At first I want to tell you that this code is too much simple, it has only 3 lines for the EPP programming port: One for indicate the address port, another to configure control port, and the third to read the port.
Even, I'm sending the entire VISUAL C++ ( Version 6.0 ) project, so you can check it.
It is an example, that shows in one dialog screen, the one byte value repetitively sended by an ADC08831 ( serial output A/D converter ) who is controlled by an SX processor.
The SX make too, the handshaking protocol to comunicate with the port.
I'm sending to you the SX code too, and please !!!!!!! don't scare with the SX code, specially the A/D conversion part, it is not an advance code at all, but it works ok.
The program will shows you, the samples taked by the A/D each 20 mSec. To increase the port speed you need to use another "read port"method, like including the _inp instruction, into a "for" or a "while" bucle. I did it with my "capture camera" software just a few months ago, obviusly I was using a flash A/D ( CA3306 ) converter in that situation. That was a more complicated aplication but the idea to controll the port was the same, I think, that this example, is closely enough simple to demostrate, how the EPP port works.
Pls, I would thank you, if you tell me, which is your opinion about all this code to btxsistemas@ciudad.com.ar .
Sincerely:
Alberto Geraci
BTX Sistemas.
Automatización-Sistemas
James Newton says "If I had known it was that easy, I would have been doing this years ago!"
The circuit is simple: For the parallel port, rb.0 is the WAIT line and rb.1 is the Data Strobe line... and RC is D0-D7... The ADC converter is connected to the SX with CLK equ rb.6, D0 equ rb.7, CS equ rb.5.
The "bulk" of the C++ code is in the adcDlg.cpp file and looks like this:
void CAdcDlg::OnEmpezar() // OnOpen in Spanish? { // TODO: Add your control notification handler code here m_uTimerID = SetTimer(0x451,20,NULL); // Will read port each 20 msec. ctrl=0x378; // LPT1 port _outp(ctrl+2, 36); // Init EPP Control register. } void CAdcDlg::OnTimer(UINT nIDEvent) { // TODO: Add your message handler code here and/or call default CDialog::OnTimer(nIDEvent); // m_dato=_inp(ctrl+4); // Read data from port SetDlgItemInt(IDC_EDIT1,m_dato,true); } The SX EPP interface "virtual peripheral" is only this: salida_puerto ;Spanish for "exit_port" clrb rb.0 ; WAIT line nopasa snb rb.1 ; Data Strobe line jmp nopasa ; nop setb rb.0 yafue sb rb.1 ; finish the handshaking when the rb.1 is high jmp yafue retp
Alberto says:
YAFUE is reality 2 words one is YA and the another one is FUE, the mean of this is like IT WAS or WENT, when somebody dies we said YA FUE or when something occurs ( past ) we said YA FUE too.The translator said the following: YA = ALREADY and FUE is the past of GO
Also:
file: /Techref/scenix/lib/io/epp-ag.htm, 3KB, , updated: 2007/4/28 05:34, local time: 2024/11/21 15:06,
3.12.146.100:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://sxlist.com/techref/scenix/lib/io/epp-ag.htm"> Ubicom SX to IBM PC EPP Parallel port interface from Alberto Geraci of BTX Systemas</A> |
Did you find what you needed? |
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. |
Welcome to sxlist.com! |
.