I'm planning to start a project using a RPi3 and Android Things. I need 50 GPIO pins (20 inputs, 30 outputs), so I have 2 options: use an expansion board, or use 2 RPis. So I have a question for each option:
If I use an expansion board: will be possible to use it with Android Things?
If I use 2 RPis: what's the best way to communicate between them? (for example: a signal received in a GPIO in RPi A, may trigger an output in RPi B)
EDIT: Here I link a post that describes 3 ways to extend RPi's GPIO ports -> https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=86738#p611850 It may be useful
EDIT 2: I will use 2 MCP23017 (16 port expander). So I will get 32 pins using only the 2 I2C pins. More info: http://ww1.microchip.com/downloads/en/DeviceDoc/21952b.pdf
I'm not familiar with Android Things but with some electronic work you will be able to achieve your results.
This 4 line decoder will only use 4 gpio pins to control 16 outputs.
http://www.nxp.com/documents/data_sheet/74HC_HCT154.pdf
The reverse process is also possible. You may use a 16 line "demultiplexer" to encode 16 bits of logic information in on 4 GPIO inputs of your Raspberry
http://www.ti.com/product/CD54HC4514
(the components I selected are the first one I stumbled across. They may not be the best products for your specific application. I used the 74HC238 before on a project and it worked like a charm)
You could consider the PCF8574, which is I2C an 8 bit port expander. You can have up to 8 of them on a single I2C bus, giving you up to 64 GPIO pins.
Here is a driver for the PCF8574 for Android Things:
https://github.com/davemckelvie/things-drivers
Related
According to:
https://www.nvidia.com/content/dam/en-zz/Solutions/design-visualization/quadro-product-literature/proviz-print-nvidia-rtx-a6000-datasheet-us-nvidia-1454980-r9-web%20(1).pdf
the NVIDIA RTX A6000 uses up to 300 watts of power. It has a single 8-pin CPU power connector and of course it connects via PCI-E. In spite of what was once stated, the PCI-E 4, to the best of my knowledge, still only supplies 75w. With the 8-pin supplying at most another 150w, my math says 225w. Other high powered cards use two 8-pins for this reason I believed. What's going on with the $5k card?
njuffa's comment had the correct answer, but I cannot select a comment as correct.
An 8-pin CPU connector is different than an 8-pin auxiliary power connector.
https://www.pny.com/file%20library/company/support/product%20brochures/nvidia%20quadro/quadro-power-guidelines.pdf
In their power guide they show how to make an adapter for two 8 pin aux to an 8 pin CPU.
I want to know if my Wi-Fi card supports MIMO (Multiple Input Multiple Output), and specifically how to find the number of antennas.
Is there a command I can run to find out?
If you're using windows type in command line: netsh wlan show all | find /I “MIMO”.
If you see MU-MIMO : Supported then it means yes.
I'm not sure how to do this in Linux aside from checking network card model and looking at technical specification. That will give you 100% correct answer.
But You can try though this: iw phy | grep index; you will see something like this:
HT TX/RX MCS rate indexes supported: 0-15
If you see the index above 7 that means your card supports MIMO. Why is that ?
MIMO requires at least two antennas to work (means two spatial streams of data) and this table explains index / streams relation.
i am currently trying to use more than 1 HC-SR04 on my BeagleBone Black (Rev C.)
I tried the following script:
https://github.com/luigif/hcsr04 And it is also working, but I have no idea, how I am able to change the used PINs and also how to use them in a serial way.
May someone help me please?
best regards
Ingo
One possible solution with the current code is to add two fast enough multiplexer to the echo/trigger pins of the sensors (8:1 or 16:1 depending on how many sensors you want to connect). The first will be to switch between trigger connections and the second to switch between echo connections. To control the mux you'll have connect the select lines of the mux to any of the GPIO pins(easiest are P8_14, P8_15, P8_16 and P8_18 since P8_11 and P8_12 are being used by PRU).
You'll have to change the present code something like this
/* Execute code on PRU */
printf(">> Executing HCSR-04 code\n");
prussdrv_exec_program(0, "hcsr04.bin");
/*Add code here to set GPIO pins high/low to choose the sensor */
/* Get measurements */
mux generally have 5v inputs and outputs, make sure that you step it down to 3V else you'll blow your beaglebone!
basic cheap mux have 35ns max response time which is more that sufficient to match the requirements
https://en.wikipedia.org/wiki/Multiplexer
http://socrates.berkeley.edu/~phylabs/bsc/PDFFiles/DM74151A.pdf
Addition: Tie all the trigger pins together and mux only the echo pins so that you'll need only one mux instead of 2
i've seen on STM32F4 Programming Manual that GPIO ports are from A to K. but in some slides i've read that are 5 ports (A to E). What these ports (F to K) do ? These are dedicated for some else ?
Thanks for the explanation.
The number of ports depends on the pin count of the specific STM32F4 model you're using. Each port has at most 16 pins, so models with, say 64 pins, will have less ports (around 4 to 5) than models with 176 pins (10 or possibly 11 ports). The datasheet indicates which peripherals are tied to which specific pins and ports, but in principle there are no "special" ports.
looking for a little help.
I'm familiar with PIC Microcontrollers but have never used Atmel.
I'm required to use an ATMEGA128 for a project at work so I've been playing around in Atmel Studio 6 the last few days.
I'm having an issue however, I can't even get an LED to blink.
I'm using the STK500 and STK501 Dev boards and the JTAGICE_MKII USB debugger/programmer.
The ATMEGA128 chip is a TQFP package that's in the socket on the STK501 board.
I'm able to program/read the chip no problems, and my code builds without error (except for when I try to use the delay functions used in the delay.h library - but that's another issue).
For now I'm just concerned with getting the IO working. I have a jumper from 2 bits of PORTD connecting to 2 of the LEDs on the STK500 board.
All I'm doing in my code is setting the PORT direction with the DDRx ports and then setting all the PORTD pins to 0. The LEDs remain turned on.
When I'm in debugging mode and I have the watch window open, I can break the code and the watch windows shows me that the PORTD bits are indeed all 0's, but the LEDs remain on.
So far, I hate Atmel. :)
Any ideas?
Thanks
Have you tried setting them to logic 1? It is common for LED circuits to connect the LED to Vcc via a current-limiting resistor, which means the output port has to be 0 to turn on the LED.
If you set it to 1 and the LED goes off, then that'll tell you it's an "active low" signal and you can reverse your logic accordingly.
Have you read the STK500's doc? It is likely, that the LEDs are driven active low.
There are two steps to follow. First you set the "direction" of the pins, because they can be used as input or output. To make the D register pins output pins:
DDRD = 0xFF;
This will set all pins on the D register as output pins. Do this first. Then code like:
PORTD != 0x01;
will set the D0 pin high. And code like
PORTD ^= 0x01;
will toggle the pin.
See this tutorial for a little more info or visit in with this community. The Atmel community is vibrant and helpful.