[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
BOUNCE rtl@rtlinux.org: Approval required: Non-member submissionfrom [Adolf Ahmad MS <adolf@ratelindo.co.id>] (fwd)
- To: rtl@rtlinux.org
- Subject: BOUNCE rtl@rtlinux.org: Approval required: Non-member submissionfrom [Adolf Ahmad MS <adolf@ratelindo.co.id>] (fwd)
- From: Der Herr Hofrat <der.herr@hofr.at>
- Date: Thu, 3 May 2001 06:07:40 +0200 (CEST)
>From owner-rtl Wed May 2 22:05:13 2001
Received: from wbmail.ratelindo.co.id (rtiwb.ratelindo.co.id [202.155.4.226])
by hq.fsmlabs.com (8.11.2/8.11.2) with ESMTP id f4345AJ11946
for <rtl@rtlinux.org>; Wed, 2 May 2001 22:05:11 -0600
Received: by WBMAIL with Internet Mail Service (5.5.2650.10)
id <JR708WPM>; Thu, 3 May 2001 10:49:09 +0700
Message-ID: <41B6E7DDA9D5D3119B5700508B8B04E10743EAF3@WBMAIL>
From: Adolf Ahmad MS <adolf@ratelindo.co.id>
To: rtl@rtlinux.org
Subject: Maximum Sample Rate using RTLINUX
Date: Thu, 3 May 2001 10:49:08 +0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.10)
Content-Type: text/plain
Dear All,
I need a help.....
I have a problem during capture data stream with data rate(sampling) 782
kByte/s using PPI8255 Card(ISA Bus). To capture the data stream, i applied
IRQ triggering.
But, some times many byte of data are lost. How many maximum transfer rate
on RTLINUX ?
As info, there is no problem if applied this program to capture the data
stream with 100 kByte/S.
Rgrds,
Adolfo
This is the module:
#define MODULE
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/rtf.h>
#include <linux/errno.h>
#include <asm/rt_irq.h>
#include <linux/rt_sched.h>
#include <asm/io.h>
#include <linux/cons.h>
#include "control.h"
#define FIFO1 0
#define size1 16384
#define FIFO2 1
#define size2 16384
/*#define size2 65536*/
/*
#define FIFO3 2
#define size3 12
*/
#define PPI 0x300
#define PPB PPI+1
#define PPC PPI+2
#define CCW PPI+3
void intr_handler5()
{
int data;
data = inb(PPI);
rtf_put(FIFO1, (char *) &data, sizeof(data));
}
void intr_handler7()
{
int data1;
data1 = inb(PPB);
rtf_put(FIFO2,(char *) &data1, sizeof(data1));
}
int init_module()
{
rtf_create(FIFO1,size1);
rtf_create(FIFO2,size2);
request_RTirq(3,intr_handler7);
request_RTirq(5,intr_handler5);
outb(0xb6,CCW);
outb(0x05,CCW);
outb(0x09,CCW);
return 0;
}
void cleanup_module()
{
rtf_destroy(FIFO1);
rtf_destroy(FIFO2);
free_RTirq(3);
free_RTirq(5);
}
==========
This is the application part:
#include <stdio.h>
#include <errno.h>
#include <sys/time.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <linux/rtf.h>
#include <string.h>
int main()
{
int fd;
int n;
int datu;
int data1;
int data2;
FILE *file1;
FILE *ftabel;
short int ket_tge;
short int ket_nol1;
short int omc;
time_t hari;
char namafile[24];
int i,j;
int idx;
char idx0[4];
/*Initialization */
i=8192;
j=0;
idx=0;
strcpy(namafile,"dummy.mt20");
ket_tge=0;
ket_nol1=0;
omc=0;
datu=0;
data1=0;
data2=0;
/* Open File */
file1=fopen(namafile,"w");
if ((fd=open("/dev/rtf0",O_RDONLY)) < 0 )
{
fprintf(stderr,"Error Opening MT20\n");
exit(1);
}
while(1)
{
i++;
if((i > 8192) && (omc > 31))
{
j++;
i=0;
idx++;
fclose(file1);
time(&hari);
strftime(namafile,22,"/m2/%m%d%H%M.A%S",localtime(&hari));
sprintf(idx0,"%04d",idx);
strcat(namafile,idx0);
file1 = fopen(namafile,"w");
/* omc=0;*/
}
n = read(fd,&datu,sizeof(datu));
omc++;
if((datu == 0x3e) || (datu==0x3d) || (datu==0x3f))
{
ket_tge=1;
data1=datu;
}
else if ((datu == 0x00) && (ket_tge==1) && (ket_nol1 == 0))
{
data2=datu;
ket_nol1=1;
}
else if ((datu == 0x00) && (ket_nol1==1))
{
fprintf(file1,"\n%02x%02x%02x",data1,data2,datu);
ket_tge=0;
ket_nol1=0;
omc=2;
}
else if ((datu != 0x00) && (ket_nol1 == 1))
{
fprintf(file1,"%02x%02x%02x",data1,data2,datu);
ket_tge=0;
ket_nol1=0;
}
else if ((datu != 0x00) && (ket_tge == 1))
{
fprintf(file1,"%02x%02x",data1,datu);
ket_tge = 0;
ket_nol1 = 0;
}
else
{
fprintf(file1,"%02x",datu);
ket_tge=0;
}
}
fclose(file1);
return 0;
}