Category Archives: Site

NixCore X1 with RGB LED Strip

My friends here in Colorado started a new company called NixCore, a Linux enabled processor board that takes 1 Watt of power. They asked me to take their new NixCore X1 product for a spin and see what I could make with it. I looked around the lab/office and came upon my RGB LED strip from China. Since this RGB strip uses a variant of SPI I thought it would be a good test for the little NixCore X1 board.

The NixCore X1 is an Ralink RT5350 SoC (System on Chip) processor running at 360MHz, with 8MB of flash, and 32MB of RAM. The board takes only 1 watt of power (less than 200mA at 5V) and has all the outputs you would expect from a microcontroller, I2C, GPIO, PWM. It also has software based SPI (Since the SPI port is used by the flash) which is still pretty fast. I’ve worked with embedded Linux systems and know how much of a pain it is to get a driver running, so having a Linux install with an SPI driver exposed to userspace was a godsent. With some commands, a simple C file, and a Buildroot compiler I was able to port my Mbed code to the NixCore X1 pretty easily. All I had to do is make a new SPI device on some GPIO pins, open the “/dev/spidev1.0” device and start writing data to it, the driver takes care of all the hard stuff. Using C you can fopen(“/dev/spidev1.0″,”w”) and then write as any other file. Here are the steps:

Build the compiler:
NixCore helped me out with that, but just select mips32r2, Little Endian and uClib on Buildroot and you should be good.

Compile the code:
Given the code, you can control the strip via the command line
(Make sure you add -I and -L entries to the buildroot install)

Install the spi-gpio-custom-driver on the running X1:
insmod spi-gpio-custom bus0=1,22,23,24,0,50000

Run the code:
./[WHATEVER_YOU_NAMED_IT]

This driver is software based and (from my tests) runs up to 400KHz. It uses GPIOs 22 as CLK,23 as MOSI and 24 MOSI (Even though there is no input data) on the NixCore X1. This translates to pins 27,30 and 22 on the header. I hooked up the RGB strip directly to the 3.3V CLK and MOSI and wrote a simple C file based on my Mbed code.

Honestly, to my surprise I was able to control a single pixel of the strip right off the bat, I expected the driver functioned but I was still a little skeptical. It didn’t take long to address the entire strip. At a comm rate of 50KHz this updates the strip at about 40ms or 25 HZ. As I mentioned the rate could be updated to about 400KHz which would be about 200Hz for a 5M strip, more than enough to beat the human eye.

After I made the C application to set the color I took it a step further and added a web page and CGI script to change the color of the strip based on a web page.

Here are some videos of the strip in action:

And, of course, the code and webpage for the processing: Code1, Code2, Makefile, Webpage files.
Goto http://[IP_ADDRESS]/color.html

Overall I really like the NixCore X1 (I am biased since they are my buddies) but you might want to check them out at http://nixcores.com.

CNC board and USB microscope

While in China I picked up a USB microscope for $25 USD. It’s an “2MP HD microscope with 600x magnification” according to the box and has 6 LEDs around the camera. I plugged it in and it was found right away by Linux as a video4linux device and works with VLC and Cheese. It’s been sitting next to my computer for about 2 weeks since I got back from China and I’ve been itching for some reason to use it. Tonight I made a small board on my CNC to test some new footprints and I thought it would be the perfect time to use the microscope to check out the cuts made by the bit. Using Cheese I was able to get some good shots of the PCB traces. The pictures are only 640×480, so I’m not too sure where the 2MP claim comes from.

I used my gcode_03 ULP script for Eagle (from my older site) to export the PCB to G-code. When I started working with the CNC for PCB routing I was using a 0.8mm end mill carbide bit, however I’ve noticed I get pretty clean cuts with a 30 degree “V” etching bit run at the max speed of my manually controlled spindle (Yes I know I need to find out the RPMs of that thing). The cuts made by the CNC are impressively clean and without burs. Each cut goes down 0.16 inches and the feed rate is 300mm/minute. The footprint is SOIC-8, the pads are 1.27mm x 0.635mm and the traces are 20mil. The cut is close to 0.5mm. The microscope did show what looks like copper particles in the track which was interesting to see. I’ve made a bunch of breakout boards and switch boards without shorting issues so I don’t know if these particles are big enough to cause a problem. Here are some pictures of the board using the microscope.

microscope image of board compared to a dime microscope image of the board microscope image zoomed in on traces

microscope image of cnc cut - two traces microscope image of cnc corner cut microscope image of cnc particles microscope view of SOIC-8 chip on pad

Reference PCB Business Card on a CNC

I’ve found myself in the situation a few times where I was trying to explain that PCBs can be routed using a low cost CNC, like the 3040 CNC I purchased on Ebay a while back.  Since I have routed dozens of PCBs this sounds obvious to me, however it is not very obvious to some of the engineers I have explained it to, it seems as if they can’t visualize what can be accomplished.  In those moments I wish I had an example PCB to show them.  Not to mention  a few times I was stuck without a quick way to measure small lengths, or I wanted to know the SMD footprint used for a resistor to see if I had one, or when I needed to compare the pin spacing of a cable to see if it is 0.1″.  A few days ago I found a post about TinkerRule, a reference PCB that could be used to solve pretty much all the engineering scenarios I just mentioned. I really liked what they did and it inspired me to see if I could make a reference PCB on my CNC in the form factor of a business card to fit in a wallet, that way not only would I have a useful tool, but I would have a demo of the capabilities of my CNC PCB router too!

It turns out that my small 3040 CNC is quite capable of making a 2.125 x 3.25″ PCB business card with a number of useful features, including an inch ruler, centimeter ruler, some reference traces, reference vias, reference holes, and  0.1″ grid.  The board also has 150 mil letters so it is easy to read.  Plus, since the single sided copper board I used is only about 50 mils thick, it’s only 50% thicker than a credit card, so it isn’t a noticeable addition to my wallet. This was the first pass and there are 2 missed sections, this was due to my setting of the router bit a little too shallow…things to fix on Rev 2.

20150103_153638 20150103_153645 20150103_223014

I have uploaded the Eagle PCB and GCode so anyone can download it and try and make their own: biz_pcb.brd & biz_pcb.ngc

I already have identified some things I want to change on Rev 2, any ideas or suggestions?

Debounce Calculator Online App

I finally got tired of punching numbers into my calculator for debounce circuits so I came up with a small javscript app to determine capacitance, resistance or time for a simple RC circuit. The script is already setup with values for input to a schmitt trigger inverter. This application is based on a single capacitor and resistor circuit as per this image.

http://protological.com/debounce-calaculator/

Welcome to Protological

Protological is a site about electronics, DIY and software.  Our goal is to educate and share our experiences and projects with the world.  We will showcase projects from across the internet as well as posting information, schematics, code and documentation on our own development.  We also design electronics and we will offer our products via our online shop for purchase.

The major topics on Protological include:

  • PCB design
  • Microcontroller code
  • Prototyping
  • Electronic product development

Our goal is to have multiple posts per week in each of the major topics on the site as well as downloadable code and project files.  We will be documenting our progress at getting these posts out and pitfalls along the way.  As we get this site off the ground we would love support from the community, share your projects, hacks, mods and prototypes with us at info@protological.com and we will get them up on the site.

Happy building

Drew