Arduinopixed Schematics

December 20th, 2018

Here is some more details and cleaner schematics of Arduinopixed. Most part of the Schematics is self explanatory but I have included some minimal explanation.

Page 1

ArduinoPixed Page 1

1. U1 is the 4 Port USB Hub.
2. J2, J3, J4 are USB Connectors.
3. U4 is a 5V to 3.3V Regulator.
4. R2 is fuse at 5V Entry point

Page 2

Arduinopixed Schematics - Sheet 2

Some explanations

1. U2 is USB to UART chip
2. U3 is ATMEGA chip
3. J8 and J9 form the header for any Add on Board
4. J5 Header is used for programming ATMEGA, if required.
5. SW3 is on board Switch
6. D1 is LED
7. R6 is thermistor that can be used for temperature monitoring.

Uncategorized

Programming ArduinoPixed

November 15th, 2018

The Arduinopixed comes pre programmed with bootloader. If however, you need to re program the bootloader, this blog should help you. Here are the list of the steps you need to follow.

1. Please purchase an Arduino Nano v3.0 board. These are available for under $2 - for example
https://www.alibaba.com/product-detail/Shenzhen-factory-Compatible-CH340-Nano-V_60571630186.html?spm=a2700.7724838.2017121.5.28492fc8oIgvnY
Make sure you buy the one that has bootloader preloaded. In the Arduino Nano with preloaded bootloader, it will blink with LED when powered ON.

2. Make a 6 Pin Cable - One end will connect to Arduino Nano board and the other end will connect to ArduinoPixed Board ( J5 Connector) . The connection will be as follows

Figure 1 : Pinout Connection between Arduino Nano and ArduinoPixed

3. Install Arduino IDE on a Windows Computer and start the Arduino Program

4. Connect the Arduino Nano with the Computer using a USB Cable. Make sure you are able to download a LED Blinking example program on it.

5. Add a 10uF Cap on the Arduino Nano board between its RESET PIN and GND ( Notice that you will have to remove this capacitor if you wish to do the step 4 above again).

6. In the Tools -> Board menu select the item that corresponds to the Arduino in which you are going to burn the bootloader(in this case, Arduino Nano w/Atmega 328 again). Then go to the Tools->Programmer menu, and select “Arduino as ISP” instead of the default “AVRISP mkII”:

7. Finally, click in the Tools -> Burn Bootloader menu item

Uncategorized

Example programs for ArduinoPixed

October 8th, 2018

ArduinoPixed adds 3 USB ports and an onboard Arduino. Setting up Arduinopixed is easy. Just use the 4 provided screws to attach it to Raspberry Pi Zero W ( Add a USB Wifi Board if you are using Raspberry Pi Zero). The Extra USB ports on the Arduinopixed allows you to work directly on the Raspberry Pi - No SSH or Serial Port required ( but you can do that if you want to). Hook the Pi Zero to HDTV using HDMI to HDMI Mini Cable. Hook a Keyboard and Mouse to the USB Ports of the Arduinopixed.

After powering it on - set up your wifi.

Install the Arduino using

#sudo apt-get install arduino

Now you should be able to run the Arduino from the menu. Here are some example programs to get you started.

Example : LED Blinking

This example will blink and LED for 1 sec and off for 0.2 second on the Arduinopixed. Note that the LED is connected on Pin 6 in place of 13 in Arduino or Arduino Nano.


void setup() {
pinMode(6, OUTPUT);
}

void loop() {
digitalWrite(6, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(6, LOW); // turn the LED off by making the voltage LOW
delay(200); // wait for a second
}

Example : LED ON off on Push button

The example will turn on or off the LED on Arduoinopixed depending upon if the the Push Button is pressed or not. The push button is connected on Pin 7 and is normally high. When the Push Button is pressed, it turns low.

const int buttonPin = 7; // the number of the pushbutton pin
const int ledPin = 6; // the number of the LED pin

// variables will change:
int buttonState = 0; // variable for reading the pushbutton status

void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}

void loop() {
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed. If it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
} else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}

Example : A/D Converter that throws Sensed value at Serial Port every 500 ms


const int analogInPin = A7; // Analog input pin that the potentiometer is attached to
const int analogOutPin = 6; // Analog output pin that the LED is attached to

int sensorValue = 0; // value read from the pot
int outputValue = 0; // value output to the PWM (analog out)

void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}

void loop() {
// read the analog in value:
sensorValue = analogRead(analogInPin);
// map it to the range of the analog out:
outputValue = map(sensorValue, 0, 1023, 0, 255);
// change the analog out value:
analogWrite(analogOutPin, outputValue);

// print the results to the Serial Monitor:
Serial.print("sensor = ");
Serial.print(sensorValue);
Serial.print("\t output = ");
Serial.println(outputValue);

//500 ms wait
delay(500);
}

Uncategorized

USB Wifi on Freescale i.MX6

April 12th, 2018

This post is about how to get the USB wifi working. The TP-Link TL-WN721N wifi Module has been used as an example but it should be possible to extend similar thing on other Wifi Modules as well.

1. In the kernel Select the Athroes HTC as module and build the kernel module.
2. Copy the generated four files - ath.ko, ath9k_hw.ko, ath9k_common.ko and ath9k_htc.ko in directory /system/lib/modules/
3. Copy the firmware file in the directory /etc/firmware/ath9k_htc/
4. Install the modules using ath.ko, ath9k_hw.ko, ath9k_common.ko
5. ifconfig wlan0 up
6. iw dev wlano scan
7. To connect to a network that does not need password use
iw wlan0 connect yourssid
8. use wpa_supplicant to connect to network that needs authentication

Uncategorized

Pre Order ArduinoPixed

March 19th, 2018

If you missed backing ArduinoPixed on kickstarter here is a chance to pre order here.

ArduinoPixed - USB Hub + Arduino for Pi Zero
ArduinoPixed - USB Hub + Arduino for Pi Zero
Hub + Arduino for Pi Zero W , Shipping is $5 in US
$23.00

Out of US : The shipping is $6 for first and $3 for each additional unit.

HubSerialixed - USB Hub + UART for Pi Zero
HubSerialixed - USB Hub + UART for Pi Zero
Hub + UART for Raspberry Pi Zero, Shipping is $7 out US
$23.00

Uncategorized

Spread Spectrum in i.mx6

March 14th, 2018

If the CPU to DDR clock fails due to the EMI, there is a quick software solution - Spread Spectrum. The changes can be made in the u-boot. You will need to create the u-boot in SPL mode. Add the following code ( located at board/freescale/mx6sabresd/).


#include <config.h>

/* Enable Spread Spectrum */
.macro spreadspectrum_vikas
ldr r0, =CCM_BASE_ADDR

ldr r1, [r0,#0x18]
ldr r3, [r0,#0x18]

/*need Delay short time before switch PLL2 it back*/

ldr r4, =0x0
pu_delay:
add r4, r4, #0x1
cmp r4, #0x200000
bne pu_delay

/* recovery the previous PLL source setting */
ldr r0, =CCM_BASE_ADDR
str r3, [r0,#0x18]
.endm

.macro spreadspectrum_rohitab
ldr r0, =CCM_BASE_ADDR

ldr r1, [r0,#0x18]
ldr r3, [r0,#0x18]

/* set periph_clik2_sel to select OSC_CLK */
and r1, r1, #0xffffcfff
orr r1, r1, #0x00001000
str r1, [r0,#0x18]

/*need Delay short time before switch PLL2 it back*/
ldr r4, =0x0
pu_delay:
add r4, r4, #0x1
cmp r4, #0x200000
bne pu_delay

/* recovery the previous PLL source setting */
ldr r0, =CCM_BASE_ADDR
str r3, [r0,#0x18]
.endm

.macro spreadspectrum
ldr r0, =CCM_BASE_ADDR

ldr r1, [r0,#0x18]
ldr r3, [r0,#0x18]

/* set periph_clik2_sel to select OSC_CLK */
and r1, r1, #0xffffcfff
orr r1, r1, #0x00001000
str r1, [r0,#0x18]

/* set periph_clk_set to switch to OSC_CLK */
ldr r1, [r0,#0x14]
ldr r2, [r0,#0x14]
orr r1, r1, #0x02000000
str r1, [r0,#0x14]

/* power down PLL2 */
ldr r0, =0x020c8000
ldr r1, [r0,#0x30]
orr r1, r1, #0x00010000
str r1, [r0,#0x30]

/* enable spread spectrum & configure */
ldr r1, =0x00001770
str r1, [r0,#0x60]
ldr r1, =0x05dc8006
str r1, [r0,#0x40]

ldr r1, [r0,#0x30]
and r1, r1, #0xFFFEFFFF
str r1, [r0,#0x30]

/*need Delay short time before switch PLL2 it back*/
ldr r4, =0x0
pu_delay:
add r4, r4, #0x1
cmp r4, #0x200000
bne pu_delay

/* recovery the previous PLL source setting */
ldr r0, =CCM_BASE_ADDR
str r2, [r0,#0x14]
str r3, [r0,#0x18]

.endm

/* End Enable Spread Spectrum */

.globl blhss
.type blhss,%function

blhss:
.fnstart
spreadspectrum
bx lr
.fnend

Save the file as spreadspectrum.S and then update the Make file to include this file.

obj-y := mx6sabresd.o
obj-y += spreadspectrum.o

In file mx6sabresd.c make following changes

  1. Just before

int dram_init(void);

Add

extern int blhss(void);

2. Just after

gpr_init();

Add following

blhss();

 

Compile and try. Results will be updated lated.

Uncategorized