Android Question How do I communicate with PIC18F45K50 controller

mebcs

Member
Licensed User
Longtime User
I have:

ODROID-U2 (Exynos4412 Prime. 1.7Ghz ARM Cortex-A9 Quad Core)
USB to IO expansion board for GPIO/PWM/SPI/UART/I2C/ADC interfaces (compatible PIC18F45K50-QFN USB Microcontroller is mounted)

I have this conencted via HDMI to a HD1080p TV as my monitor.
I want to perform I/O using push buttons and LEDs but don't know how to address the USB I/O device.

Anyone else have one of these? I could use some advice.
 

Attachments

  • IO.jpg
    IO.jpg
    318.8 KB · Views: 258

mebcs

Member
Licensed User
Longtime User
As my first time programming for USB let alone an IO board I am having difficulty.
I attached my b4a program, modified from another posted example.
I have also included the JAVA app that does communicate with the IO device. I am not a JAVA programmer but I was able to run the program and captured the screen. It shows the address the device was found at, maybe?
I ran the b4a program and captured the screen.

I need some help. If I can get the led to turn on/off I think I can proceed with the rest.
 

Attachments

  • Screenshot_java.png
    Screenshot_java.png
    63.1 KB · Views: 238
  • SimpleDemo-AndroidSoftware.zip
    85.8 KB · Views: 270
  • Screenshot_b4a.png
    Screenshot_b4a.png
    156.9 KB · Views: 251
  • ODROID-U2-IO-b4a.zip
    8.2 KB · Views: 247
Upvote 0

walterf25

Expert
Licensed User
Longtime User
PIC18F45K50-QFN
The USB indicates 4 devices. I iterate through them all, but, they all have the save device details.
Why don't you go wireless, just use a bluetooth adapter, this will make things much simpler.
 
Upvote 0

mebcs

Member
Licensed User
Longtime User
Why don't you go wireless, just use a bluetooth adapter, this will make things much simpler.
What?
This a wired USB interface for I/O. It reads external switches and changes LED states among other things.
I use Bluetooth for my keyboard and mouse.

USB Connector 1--->USB Hub ----->Bluetooth Adapter--->Keyboard
--->Mouse
----->I/O Board
USB Connector 2--->Wi-Fi Network Adapter
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
What?
This a wired USB interface for I/O. It reads external switches and changes LED states among other things.
I use Bluetooth for my keyboard and mouse.

USB Connector 1--->USB Hub ----->Bluetooth Adapter--->Keyboard
--->Mouse
----->I/O Board
USB Connector 2--->Wi-Fi Network Adapter

Hi mebcs, i really think it would be better if you did what you're trying to do through a bluetooth module, please check this thread where i posted an example, i posted the code for the android side and the code for the microcontroller, i'm using an Atmega168p and using a Basic compiler called Bascom AVR.
Hope this gives you a more open perspective of what i mean.
http://www.b4x.com/android/forum/threads/bluetooth-microcontroller-communication.24604/#content

So basically you would connect the bluetooth adapter such as the RN-42 to the tx and rx lines on your microcontroller, once you establish a connection from your android phone to the bluetooth module you can send data to the microcontroller and controll the i/o lines on the microcontroller.
 
Upvote 0

mebcs

Member
Licensed User
Longtime User
OK. I didn't understand where you were going. I am doing a lot of reading now and it does look interesting.
 
Upvote 0

mebcs

Member
Licensed User
Longtime User
Walter,

I thought I saw somewhere you had a video. I would like to see it. I would also line to see a picture of the Bluetooth device connected to the controller. I am going to need a more turnkey solution. I may post a work-for-hire entry.
I need to be able to control I/O for maybe 6 switches and some LEDs. I need a parts list and someone to program anything after the android system.
 
Upvote 0
Top