[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

USB PIC



Hi I need to send data to USB PIC16c745 this is my c code.

int main(){
	struct usbdevfs_bulktransfer bulk;
	int fd;
	int ret,*data,dato=0xFF;
	data=&dato;
	fd = open("/proc/bus/usb/002/003", O_RDWR);
	if(fd != -1) {
		bulk.ep = 1;
		bulk.len = 1024;
		bulk.data = data;
		bulk.timeout = 1000;
		ret = ioctl(fd, USBDEVFS_BULK, &bulk);
		perror("ioctl");
		if (ret < 0)
			printf("Error in bulk transfer\n");
   		/*else {
      		
   		}*/
   		close(fd);
	} 
	return 0;
}

But it send to me a ioctl device or resource busy. I try too with libusb: 

usb_interrupt_write(udev,1,byte,8,10)

but i got the same message device or resource busy. In win98 I can
send data to USB PIC16745 with the same firmware. I got the firmware
and control OCX in this page
http://www.alecmcnamara.freeserve.co.uk/piccalc/.

But I need to make it on GNU/Linux.

Thank you



Reply to: