Android Question Communication with Michroship PIC 16F1459

alainb4a

Banned
Hello,

I would like to communicate with a device based on a Microchip PIC 16F1459

Using UsbSerial and trying to understand UsbSerialDemo,I always have the following :

"Error opening USB port 1"

I tried version 2.3 and 2.4 with 115200 and 9600 Baud without any better results.

Do you know how to solve this problem?

Thanks in advance

Alain
 

alainb4a

Banned
Hello Erel,

the output of usbdetails1 is:

RawDescriptors (59) : 12 01 00 02 00 00 00 08 D8 04 ED F4 02 00 01 02 00 01 09 02 29 00 01 01 00 C0 32 09 04 00 00 02 03 00 00 00 09 21 11 01 00 01 22 1C 00 07 05 81 03 40 00 01 07 05 01 03 40 00 01
Manufacturer (8) : 34 03 4D 00 69 00 63 00
Product (8) : 2E 03 53 00 69 00 6D 00
Serial (4) : 04 03 09 04 69 00 6D 00

Manufacturer : Mic
Product : Sim
Serial : not available
DeviceName : /dev/bus/usb/001/003
DeviceClass : USB_CLASS_PER_INTERFACE (per-interface basis)
DeviceSubClass : 0
Device ID : 3EBh
ProductId : F4EDh
VendorId :4D8h
B4aInterfaceNumber : 0
InterfaceClass : USB_CLASS_COMM (human interface
InterfaceSubClass : 0
InterfaceProtocol : 0
EndpointNumber : 1
EndpointDirection : In
EndpointType : USB_ENDPOINT_XFER_INT (interrupt)
EndpointAttribute : 3
EndpointInterval : 1
EndpointMaxPacketSize : 64
EndpointNumber : 1
EndpointDirection : Out
EndpointType : USB_ENDPOINT_XFER_INT (interrupt)
EndpointAttribute : 3
EndpointInterval : 1
EndpointMaxPacketSize : 64

Thanks

Alain
 
Upvote 0

Toley

Active Member
Licensed User
Longtime User
Hello Alain, first of all it is Microchip not Microship (like in the title). If your device is enumerated as a HID device it will probably not be possible. But if your device is enumerated as a CDC device (Virtual COM Port) then you will be able to communicate with it using the USB Serial library.

You will have to add the VID/PID to the device_filter.xml file and detect your device as a Custom Device. If I remember well Silicon Labs CP2102 is a good driver for this kind of IC.

I already made this kind of communication with is little brother the 14 pins PIC16F1454. If you need more help then feel free to ask. And if you speak french I also do.
 
Upvote 0

alainb4a

Banned
Hello,

Apres quelques test il semblerais sue je sois en HID (InterfaceClass : USB_CLASS_COMM (human interface).
Est t-il possible malgré ça de développer une application androïd ?

Merci toute sugestion est la bienvenue.

Alain
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
Hi Alain,
If beside the USB port, your mController also has RS485/RS232 port, then you can connect it to HC-6 Bluetooth module and use the serial library in your App in the Android device.
If you only have USB port, then still you can use USB <> serial converter, and connect the Bluetooth module to the serial side of the
converter.. (normally it has the USB on one side and 4-pins on the other side for Vcc, Gnd, Rx and Tx, that you can directly connect to the 4-pin port of the Bluetooth module. (you will cross the Rx and Tx of both devices)
 
Upvote 0

Toley

Active Member
Licensed User
Longtime User
Thanks Beja, Toley

and whith other development tools for android is it possible ?
I don't know, this forum is dedicated to basic4 android and this is the only tool I use for android. Maybe if you seach the Market you can find an app than can communicate with this kind of device.
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
Thanks Beja, Toley
and whith other development tools for android is it possible ?

I don't think you can find a better platform then B4A..
B4A gives you the power of .net and Java combined.. you can embed Java (as is) in your code, beside the powerful string manipulation.
 
Upvote 0
Top