Arduino lenoardo + AR9331

Hi All

As the topic name implies.. How can I communicate Arduino Yun without the AR9331 Design (Arduino Lenoardo) with the Ar9331??

In a simpler Question.. What are the communication pins between the atmega32 and AR9331 ??

Thanks..

Your best bet is to look at the schematics for the Yun, or the Yun Shield. In essence, the serial TX/RX pins of Leonardo's '32U4 processor (Arduino pins 0 and 1) are cross-connected to the console RX/TX pins of the AR9331. Of course, you will have to use level shifters to translate between 5V on the Leonardo side and 3.3 V on the Linux side. The level shifters on the Yun have enable lines controlled by GPIO on the AR3391, but that is not an essential part of the communications link, you don't have to have it if you don't want it.

There are other connections between the two processors, but they are not required for normal operation. One is the handshake line that goes to Arduino pin 7: this also has a GPIO enabled level shifter which is disabled by default. Another is a set of SPI connections to the ICSP header that allows loading a sketch from the Linux side.

Thank you ShapeShifter for the info..

After some digging in the schematic, I found the communication pins between the atmega and the atheros are as follows:

1-ICSP Programming Pins (MISO-MOSI-SCK-SS) 2-UART PINS (TXD1-RXD1) 3-HANDSHAKE PIN 4-RESET PIN ( 32U4_nRESET)

ICSP Pins will be used to load a sketch from IDE to the atmega (I wont use the microUSB Programming Cable), and as I understand from your words that if it's connected to the Atheros -via Level shifter- it can be used to load a sketch from the atheros.

But What's the purpose of the handshake pin ?? Also am I missing any communication pins between the atmega and atherors?!

In fact Im willing to redesign (Arduino Leonardo) OR (Arduino Yun without the Linux Side) and attach it to an External Atheros Module.

I'm not aware of any additional pins between the processors. (But that doesn't mean there are none! ;) )

The AR9331 uses a Linux version of avrdude to load a sketch, where it uses GPIO pins to bit-bang the SPI interface to the ICSP pins. On a Yun, take a look at /usr/bin/merge-sketch-with-bootloader and /usr/bin/run-avrdude. These are the files that are called when you load a sketch with the IDE over the network.

The handshake pin is a non-dedicated general purpose pin between the processors. By default, it is disabled, but can be enabled for any purpose you want. I often use it as a signal that the Linux processor has booted, and this lets the sketch do other things before calling Bridge.begin() which would otherwise hang until Linux was ready. Basically, in the sketch, I set pin 7 to be an input with pullup, and keep checking it: when the sketch sees the line go low, it knows Linux is ready. On the Linux side, in rc.local, at the end of the file, I set the handshake GPIO line to be an output and low, and enable the level shifter. While Linux is booting, the pullup resistor on pin 7 keeps the line high. Once Linux is booted, the line goes low.

The handshake line can be used for any purpose, in any direction: it's only limited by your imagination. You could even set pin 7 to be an input in the sketch and ignore it. This would allow the Linux processor to have direct access to the pin 7 of the shield connector for use as a direct input or output.

Thank you for your reply ..

While designing the bridge between atmega side and linux side, I noticed that (in the Yun schematics provided by doghunter) the Level Shifter ICs use 2.5v at the Linux side, but as you know the Linux Side is powered at 3.3v.

So Is there a difference if I use 3.3v instead of the 2.5v ??

Thanks

This is the Linux module I will attach to atmega side..

https://3cmade.en.alibaba.com/product/60506032563-218161922/Oolite_V1_wireless_module_high_speed_AR9331.html

What confuses me why -in Yun schematics- 2.5v is used at the Linux Side?!!

Korawy:
So Is there a difference if I use 3.3v instead of the 2.5v ??

Looking at the AR3391 datasheet (small snippet attached) the preferred I/O voltage is 2.5V, with a maximum of 2.75V. I’d say driving the I/O pins with 3.3V might be a bad thing.

The chip may have a 3.3V supply pin (or pins) but it also needs several other voltages.

Korawy:
This is the Linux module I will attach to atmega side…

Buy Oolite_V1_wireless_module_high_speed_AR9331 in China on Alibaba.com

Looks interesting, and at a very attractive price - that is, if you need 1,000 of them! :o

Very Well…thank you

So I will supply the Module with 3.3v Power and the I/O to 2.5v as the Yun schematic, But I cant find a Power schematic for the 2.5v in the Yun schematics…however I found this one in the Yun schematic (attached) and I dont know if it’s sourcing or sinking the 2.5v ( May be it 's a voltage divider :smiley: ).

Also for AVDD20 and VDD_DDR, I think both of them are supplied by the module itself, but what do you think about vdd12?!

Thanks…

VDD25.png

That schematic section you posted is a pushbutton input to the AR3391. It is neither a voltage source nor sink.

R97 is a pullup resistor so GP20 of the AR3391 will see 2.5V if switch S1 is not pressed. If S1 is pressed, GP20 will be grounded.

R98 is a zero Ohm jumper: I suppose it is there to make it easy to isolate that part of the circuit to allow hacking modifications without cutting traces. Because it has no resistance, this is not a voltage divider.

D1 (or is it D11, hard to tell) is an ESD protection device to help prevent high voltage static spikes from entering the processor if someone with a built up static charge touches the switch.

While it's fairly easy to recognize the intent of this part of the schematic (I assume it's actually the WLAN RST button) I am in no way an expert on the Yun hardware - I only know what is in the published schematic, and have only briefly skimmed over the AR3391 data sheet. I can't answer the more specific questions, nor will I make assumptions about what your proposed module does or does not provide.

Before finalizing the details of a complicated board like this, you really do need to do your homework and carefully study the AR3391 data sheet, and any and all specifications and documentation of your proposed module. Getting the official AR3391 data sheet may require you to sign an NDA (Non-Disclosure Agreement) with Atheros, and getting the detailed documentation of your module may be difficult as that level of documentation is often simply not available for cut price Chinese copies of hardware devices.

I wish you good luck in your project, but I think you will have an uphill battle when it comes to documentation.

Im just the Hardware guy :D .. Im just trying to make a module just like Yun for home automation, at First I tried to design the whole schematic but i found it impossible as arduino authors didnt share Full schematics specifically the Linux side..

Now Im trying to make a one complete design from the schematics of Leonardo and Yun trying to reach each pin at the schematics hoping that the schematics of the atmega side (in Leonardo and Yun) and the bridge connections in the Yun schematic (between atmega and atheros) are true.

But here's an annoying point that there's no any schematic for the 2.5v power, it is just added from nowhere.

Anyway Thank you fro your great help..