How do I detect if a USB shield is connected during setup?

igorlopez

  • Newbie
  • *
    • Posts: 2
    • View Profile
Hi, I am building a smal GPS logger using the TinyDuo processor board, TinyFlash and the TinyGPS board.
The above stack is always connected but for uploading the logged GPS data from flash my plan is to connect a USB shield and then from the PC request the latest logs.
This is where I see a problem since both the GPS and the USB has UART interface so the initialisation of the SW during setup needs to check if the USB shield is connected and if so skip turning on the GPS.
I am new to the Arduino world but very familiar with larger 32 bit MCU's.
Also, I am planning to write all software myself (except the CRT) but given arduino library functions I should be able to to similar stuff in my setup.


igorlopez

  • Newbie
  • *
    • Posts: 2
    • View Profile
Ok, I have now gone thru all schematics and it looks like it could have been possible to detect if the USB shield is connected to the stack since if the TinuDuino had access to the VIN pin in the expansion (pin 10) which is the gatesignal to Q1 on the USB shield board which probably would have different values when USB board is stacked or not (do not have probes small enough to measure on the expansion connector)

So my not so elegant solution will be to add another switch to the casing to manually select if USB shield is connected or not which gives me a new problem of finding other switches for Power and GPS logging On/Off and USB stacked so it fits on the small (50x50 mm case)

And I was probably not clear over why my logger would have a conflict between GPS UART and USB UART and that is since I will change the GPS Interface from SW (AD0/AD1) to HW (IO1/IO0) by moving R2/R3 to R4/R1.


KennediVon

  • Newbie
  • *
    • Posts: 1
    • View Profile
Use a specific pin to check for voltage or change the state of the USB shield. For example, connect the shield's ground and power lines to digital pins and during setup, use code to check if the pins are high.


 

SMF spam blocked by CleanTalk