Sonsivri

Electronics => Projects => Topic started by: gurksallad on July 17, 2019, 08:40:40 08:40



Title: Which PIC for USB-connection to Android?
Post by: gurksallad on July 17, 2019, 08:40:40 08:40
I've been in the PIC16-world for ages and know that arcitecture very well. However, for the next project I need to interconnect a hardware design with a phone running Android, using USB. None of the PIC16 has USB-capabilities so I have to step up a few levels.

PIC24 seems to have both host and device mode, but this MCU seems to be ridiculously complex to jump into.

PIC18 has got device-mode for USB, no host mode.

Will device-mode suffice if my goal is to control the hardware from the Android-phone? That is, the hardware will be the slave and the Android will be the master. Android will send simple commands like "light LED, start MOTOR", and so on.


Will PIC18 do here or do I need PIC24/PIC32?


Title: Re: Which PIC for USB-connection to Android?
Post by: pickit2 on July 17, 2019, 08:45:28 08:45
there are samples for PIC18F4550 in Proteus. they work well in demo mode.


Title: Re: Which PIC for USB-connection to Android?
Post by: Ahmad_k on July 17, 2019, 10:04:40 10:04
You can use 18F14K50, small package (20 pin) also supported by MCC if you wish to use XC8 compiler


Title: Re: Which PIC for USB-connection to Android?
Post by: towlerg on July 17, 2019, 01:30:08 13:30
Also look at 18F25K50, it's compatible with 2550/4550 code but with a few nice tweaks eg second USART, both SPI and I2C simultaneously, crystalless USB and still 5v.


Title: Re: Which PIC for USB-connection to Android?
Post by: tumbleweed on July 18, 2019, 12:14:41 12:14
Quote
None of the PIC16 has USB-capabilities so I have to step up a few levels
There's the PIC16F145x (16F1454, 16F1455, and 16F1459), but they're fairly limited. I'd second towlerg's recommendation for an 18F25K50.

Quote
Will device-mode suffice if my goal is to control the hardware from the Android-phone?
Yes, as long as your android device supports USB-OTG


Title: Re: Which PIC for USB-connection to Android?
Post by: towlerg on July 18, 2019, 12:53:01 12:53
Somebody correct me if I'm wrong but even if the Android device doesn't have OTG (both device and host) it will at least be a host.


Title: Re: Which PIC for USB-connection to Android?
Post by: tumbleweed on July 18, 2019, 03:52:31 15:52
USB host mode was introduced quite a while ago in Android 3.1, so these days that's probably true (but you never know)


Title: Re: Which PIC for USB-connection to Android?
Post by: sadman on July 18, 2019, 06:34:37 18:34
I've been in the PIC16-world for ages and know that arcitecture very well. However, for the next project I need to interconnect a hardware design with a phone running Android, using USB. None of the PIC16 has USB-capabilities so I have to step up a few levels.

PIC24 seems to have both host and device mode, but this MCU seems to be ridiculously complex to jump into.

PIC18 has got device-mode for USB, no host mode.

Will device-mode suffice if my goal is to control the hardware from the Android-phone? That is, the hardware will be the slave and the Android will be the master. Android will send simple commands like "light LED, start MOTOR", and so on.


Will PIC18 do here or do I need PIC24/PIC32?


Did you ever heard about google ioio board based on PIC18K it is and open source hardware software plate form directly driven from your android device and provide excellent feature i have made it for my personal use here is detail what IOIO can perform.

IOIOLib Basics - overview of IOIOLib.
IOIOLib Core API - introduction to the IOIO interface.
IOIOLib Application Framework - an important set of utilities that simplify IOIO-based application authoring.
Building IOIO Applications With Gradle - the latest and greatest way for building IOIO applications using Gradle, Maven and Android Studio.
Digital I/O - get those 0's and 1's in and out.
Analog Input - measure voltage.
PWM Output - generate pulse width modulation signals.
Pulse Input - measure pulse width and frequency.
UART - communicate with serial devices.
SPI - control SPI devices as a host.
TWI - control I²C and SMBus devices as a host.
Capacitive Sensing - touch-sensing by measuring capacitance.
Motor Control Sequencer - precise and synchronized control of various kinds of motors and actuators.
Resources
Downloads - this page has links to download all the software and firmware you'll need for development.
Release Notes - change log of the various versions of the software and firmware.
Supported Devices - a list of all tested devices.
Supported Bluetooth Dongles - a list of all tested bluetooth dongles.
Tools
IOIO-OTG Bootloader and IOIODude - a guide on using the IOIODude application that lets you upgrade the firmware on your IOIO-OTG board.
The IOIO Manager Application - a guide on using the Android application that lets you upgrade the firmware on your IOIO v1 board.
IOIO Bridge - use IOIO with the Android emulator or with a target Android being debugged.

all required info can be downloaded from here

https://github.com/ytai/ioio/wiki


sadman


Title: Re: Which PIC for USB-connection to Android?
Post by: gurksallad on July 21, 2019, 07:30:15 07:30
I've heard about IOIO, but alas it will not fit for this project. The PCB will reside inside a DB36-shell.

A IOIO might be good for debugging, though.


Title: Re: Which PIC for USB-connection to Android?
Post by: sadman on July 27, 2019, 02:36:05 14:36
I've heard about IOIO, but alas it will not fit for this project. The PCB will reside inside a DB36-shell.

A IOIO might be good for debugging, though.

There are some small footprint chip that can fit inside the DB36-SHELL IOIO code is open source and you recompile it for other chips which have USB support mainly it was develop for control hard attach with it via blue tooth or WiFi using android device.  


Title: Re: Which PIC for USB-connection to Android?
Post by: XxMohannadxX on August 05, 2019, 01:04:35 01:04
PIC18F4550


Title: Re: Which PIC for USB-connection to Android?
Post by: techneo on August 07, 2019, 05:17:06 17:17
A 20-pin mcu pic18k13k50  could do fit in the space you require...

A board is already available at the following address

https://rusticengineering.wordpress.com/tag/pic18f13k50/




-techNeo


Title: Re: Which PIC for USB-connection to Android?
Post by: gurksallad on October 09, 2019, 10:17:05 10:17
18F4550 seems it might work. I will give it a try.


Title: Re: Which PIC for USB-connection to Android?
Post by: towlerg on October 10, 2019, 08:10:56 20:10
I don't know how that happened (my thank you), finger trouble? decrepitude?

Unless you need lots of gpio, 18F2550 or even better 18F25K50 is just as capable but in a much smaller package.


Title: Re: Which PIC for USB-connection to Android?
Post by: MisterX on October 10, 2019, 11:45:50 23:45
I suggest you PIC16F1454 this is the smallest MCU (14 pins) with USB.


Title: Re: Which PIC for USB-connection to Android?
Post by: towlerg on October 10, 2019, 11:51:19 23:51
Perhaps the lowest pin count but very short on Ram. If physical size is an issue, use a 25K50 and some other package than PDIP.


Title: Re: Which PIC for USB-connection to Android?
Post by: Martin Miranda on February 15, 2020, 11:38:50 11:38
i did not bothered with using the usb in pic mcu... i just resorted to using fdti's usb-uart instead.