# [SOLVED]Advice on the project needed

Status
Not open for further replies.

#### kanonka

##### Member level 1
I need help on a design decision. I even not sure that this is right place for this question, in which case please move it to the appropriate place.

My project is a medical device that needs to be controlled via touch-screen GUI.
Electronic part is controlled via 16 DACs (which are controlled via SPI), and gets data back via 16 ADC (actually, only 2 ADC, but switchable via parallel adressing).
So, I need something that can support SPI, plus 6 GPIO, plus 2 ADC inputs.

Then it all comes into GUI, (where user does changes), and then data should be communicated via network (either ethernet or WIFI) to a central server.
Originally I thought to use BeagleBoard Black, connected to a touch screen LCD. Problem is the cost: $45 for the board + ~$50 for LCD + ~$25 for touch-screen overlay (minimum prices!), plus overall complexity (ever heard about Linux touch-screen interface? Me neigher). Then I got an idea - why not to use Android tablet? Decent 10" Android can be had for ~$60, then connect it to either Arduino board ($25) via USB, or to some PIC+USB combo (any idea which one?). The only issue here that this board should be fast one (100Mhz or faster would be ideal; 16MHz of Arduino might get ... not enough. In 50us I should set 2 DAC values via SPI, switch 2 ADC via GPIO, read value from each of 2 ADC, send 12 data bytes via USB to Android, and read 4 bytes back). Benefits - cheaper + much easier to develop (Arduino/PIC program is VERY simple; most complexity sits on Android). Problems: 1) No ethernet port anymore. 2) integration into my device. All Android tablets come as finished device that I somehow need to attach to the box where I got my PCB etc. End product going to look like pieces glued together instead of nice looking integrated thing. Also, there are extra pieces that I don't need (battery, SIM-card). Yes, I can remove them (doh!), but if they are excluded to beging with, device would be cheaper. 3) All unnecessary functionaly of Android. Ideally, user should be able to see only my program, and nothing else (sort of like POS-devices in stores). No idea, how to achieve that. Or may be there is another solution that I'm overlooking? - Please advise! Thank you! #### horace1 ##### Advanced Member level 5 kanonka ### kanonka Points: 2 Helpful Answer Positive Rating #### kanonka ##### Member level 1 Well, device by itself looks great, and just as what I need, but here is the deal. For a start, I'm going to make my project in small quantities (very small). Prices for parts in quantities of 1-10 are skyrocket high. To have just one Ethernet connection (from socket housing to the chip), it'll cost me more than some ready-made board. For example, just a transformer for Ethernet (HX1198FNL) costs$3.86 when you buy at least 10 of them. Add receptacle, diode array ($1.54), 9 pull up resistors, 6 capacitors - and you are looking at price of at least$7. That is provided that whole eval board, of, for example EK-TM4C1294XL, costs just $20 (that's including MCU, 2 USBs, Ethernet, etc). And then I somehow will need to add TCP/IP stack code to my program (obtaining IP address via DHCP, transmission, etc - all that OS does for me). Honestly, at this point I'm thinking either to ditch ethernet connection altogether, or just use BeagleBoard or Raspberry PLUS Android tablet (as a screen). Actually, I cannot believe the situation - it is cheaper to buy whole tablet device than just a touch-screen of the same size (!). May be I'm just not seeing another way of doing things... #### horace1 ##### Advanced Member level 5 could you use an Android tablet with the TI EK-TM4C1294XL? it has USB, Ethernet, ADCs, etc you would need to add the DACs on a daughter baord serevral times we have used off the shelf development boards in projects where the numbers are small and it is not worth making our own PCBs #### kanonka ##### Member level 1 I was thinking about using that board, yes. Main problem with this config is still with Ethernet. Right now I'm thinking about this config: use PIC32MX695F512L as a controller for my circuits, and just add USB hub + USB-Ethernet adapter on my PCB. So, basically, USB from Android tablet will plug into USB hub, and Android would see 2 USB devices: one PIC32MX695F512L, and one USB-Ethernet adapter. Price-wise I'm looking at ~$9 for MCU, ~$7 for the ethernet electronics, ~$3 for the USB-Ethernet chip, ~$1.5 for USB receptacle, but I have no idea how to implemet USB hub. Without hub total cost comes to about$20. The idea is to offload Ethernet to Android, and use PIC32MX695F512L just as a controller for my things.

Or am I overthinking it? I just really don't want to dive into TCP/IP from scratch on PIC32MX695F512L; as well I don't want to load whole OS onto it (although it seems like FreRTOS can run on it) - it just adds too much unneeded complexity and a steep learning curve to what otherwise is very ordinary task.

#### SunnySkyguy

For starters, define purpose of project for proof of concept with minimum budget
Although is not necessary here to disclose the end product or define everything, if you have done this before. Otherwise, it is essential to learn how to do this in doing ANY design.

Thinking about possible implementations with an insufficiently-defined requirement is like fishing without bait.
Like 16 channels at 100Hz BW is quite different than 10MHz.

1) Peripheral inputs and outputs. Qty, Analog/Digital specs; range, Bandwidth, sampling rate etc
2) Peripheral Processes: Hardware/Firmware Digital to serial port
3) Host Processes, with all inputs/Outputs ( Touchscreen, Host Database, etc)
4) Host inputs and outputs

or organize as Hiearchical Input Process Output (HIPO) with no more than one page per concept at any level ( top down)

Before you forget about some details that will change the whole design, put down ALL the MUST HAVES as "Will have" and Negotiable requirements and " Nice To Haves" separately.

Is this a Bottom's Up Design using Discrete Components? No
Is this a Top Down System integration of low cost periperhals? Yes ( with mobile device touch-screen interface )

#### horace1

does the tablet have internet connection? if so why not use that and use a simpler device such as a PIC24 with USB to control your circuits?

#### kanonka

##### Member level 1
Yes, tablet has WIFI.
Problem is, the end user might not have WIFI enabled, or not have it at all, i.e. have only wired network.
Yes, this is rare case these days, but I'd like to have that option if this does not add too much complexity.

Right now tablet controlling PIC via USB looks like cheap and easy solution - until I add Ethernet into the equation. Once Ethernet is there, things are getting either expensive, or complicated. Or may be I'm overlooking some other solution, as I never did this type of system before.

I might be forced to drop Ethernet requirement from the project, but if it can be added relatively easy, I'd like to keep it - this makes final device more competitive.
Once again, I'm VERY good in Windows development, can do some Android, can do naked C/C++ with no OS, but when it comes to Linux - I'm getting to the area where I'll spend a LOT of time to get things done, especially when we are talking about very low level things like TCP/IP stack from scratch.

This why I originally was settled on BeagleBoard - everything is already done there, all interfaces are up and running, and I worked with the board before - very simlpe and easy. But, adding touch-screen to it is a) expensive and b) I'm not sure if there is any lib that deals with tocuh-screen interface in Linux.

When Android idea came in, everythuing looked even simpler, except this Ethernet thing.

#### horace1

I would suggest using the WiFi on the tablet and in cases where there is no WiFi add the option of Ethernet using a device such as the Lantronix XPORT serial to Ethernet
https://www.lantronix.com/device-networking/embedded-device-servers/xport.html

all the complexity of the TCP/IP stack is built into the XPORT device
you send simple commands via a TTL serial connection (connect it to a spare UART on your microcontroller)
given a suitable crystal you can run up to a baud rate of 921,600 bps
the XPORT are fairly expensive but it could be an option to your device

#### kanonka

##### Member level 1
Thanks to everyone for the help. Actually, conversation helped to sort my thoughts out and gave me right direction to dig into.
Here is configuration I'm going to try:

1) Use PIC32MX695F512L as a controller for my circuit (~$9); 2) Add usb hub circuit based on USB2412 (~$5.8 for low quantities);
3) Add usb-ethernet adapter circuit (~$10). 4) Attach Android tablet to USB hub and control PIC32MX695F512L from it. Total cost comes to ~$25 plus cost of Android tablet (~$60). Now I just need to combine all this together.... #### horace1 ##### Advanced Member level 5 you probably don't need the USB hub the PIC32 has USB device capabilites so you can attach it directly to the tablet, e.g. use HID or a similar simple protocol for communication I have used the USB HID protocol to control devices such as the Bytronic Mechatronics trainer connected to a laptop https://www.bytronic.net/html/pic24tb.html on the host laptop programs can then be written in C++, C#, VB.NET etc to control the devices on the baord (LEDs, motor, LCD display, etc) #### kanonka ##### Member level 1 Hub is needed so Ethernet can bypass PIC32. So connections look like this: Ethernet------>Ethernet to USB circuit--------->USB hub circuit|| PIC32----------------------------------------->USB hub circuit|| ------------> to tablet If there is no hub, I'd have to do this: Ethernet------>PIC32------>tablet (via USB) Or this: Ethernet------>Ethernet to USB circuit--------->PIC32------>tablet (via USB) Either way, without hub PIC32 will need either implement TCP/IP stack, or provide USB hub functionality by itself, i.e. will take processing power away from driving my circuits and give me headache of the writing code that I don't know even where to start with. USB hub allows to add Ethernet to tablet without even touching PIC32. - - - Updated - - - Actually, I found this chip: AX88772 but cannot find any pricing or availability. Also, Microchip has something similar, but I don't even see chip name (!): https://www.microchip.com/pagehandler/en-us/technology/ethernet/devices/products/usbtoethernet.html I'll continue to look for a combo - may be it'll be simpler and cheaper... Found one: LAN9512. Chip price is ~$5, it is 2-USB hub combo plus ethernet. Just what I need!
But eval board is over \$200.. wtf?!

P.S. Man, I feel soooo stupid - LAN9512 is the one used in Raspberry Pi...

Last edited:

#### horace1

the Microchip USB/ethernet dev kits are expensive
however, if you do a web search for USB hub with Ethernet if will give plenty of links to much cheaper devices that may meet your requirements

Status
Not open for further replies.