Showing posts with label Microchip. Show all posts
Showing posts with label Microchip. Show all posts

Sunday, January 20, 2013

USB RS-485 Adapter Through Hole PCBs Revisited

The second batch of through hole PCBs arrived recently.  I had fixed errors in the original design, moved some components around, corrected the silkscreen, and added silkscreen labels.  The design was uploaded to China, services paid for, and twelve PCBs were handed to me by the postal worker about four weeks later.

The worst offence of the original design was necessary green wire jumps and cuts rework for the Vcc and Vusb lines.  This new board doesn't require any rework.  I built up two boards and one works, and unfortunately I snipped a power line on the second board while trimming leads on a capacitor and some green wire solved the problem (oops, but good save!).

The silkscreen labels are a bit too small to see with my eyes, but make the board more usable.  I moved the JITE socket out so it hangs off the board with the benefit of the board also fitting screw terminals like those used in my (mostly) surface mount USB RS-485 Adapter board.

Sunday, December 2, 2012

I2C EEPROM Shield and Platforms Roundup



 
This I2C EEPROM shield was built to study I2C communications.  This two-wire bus involving bidirectional clock and data lines was invented by Philips (now NXP) to support a single master and multiple slaves.  A concise explanation and pseudo code is available on Wikipedia.   The shield is composed of a Microchip 24FC1025 which is a 1024 megabit (128 kilobyte) EEPROM, and supporting circuitry of jumpers, sockets, and resistors.  The jumpers provide options for the implementation to support a variety of platforms. 
 
Note: there is a strong advantage to using the I2C 24FC1025 over its SPI cousin the 25AA1024 that I highlighted in another EEPROM Shield article.  The I2C version has a simple API: write the address, then read/write bytes.  The SPI version has a complex API including erasing the whole chip, erasing a page, writing a page of memory, etc.  While the SPI device adheres to some JEDEC standards allowing for interoperability and has faster protocol speeds (20MHz) than the slower I2C device (100 kHZ, 400 kHZ, or 1MHz), using an I2C EEPROM is much faster to develop for time to market when engineering from scratch.
 
 
The form factor of the EEPROM shield supports the original Arduino such as the Duemilanove.  This also makes it compatible with a variety of other Arduino boards, and boards that are compatible with the Arduino shield form factor.  I have access to quite a few boards that are either directly compatible with this shield, or easily adapted.  Testing these boards with the EEPROM is summarized in the following table:
 

Board Type VCC Pullups SDA/SCL Solution Notes
Arduino Duemilanove arduino 5V internal A4/A5Wire.h  
Arduino Leonardo arduino 5V external D2/D3 Wire.h  
chipKIT Max32 arduino 3.3V external D20/D21 Wire.h 1
chipKIT Uno32 arduino 3.3V external A4/A5 Wire.h 2
Netduino Mini netmf 3.3V on board 9/10I2CDevice 3
Netduino Plus netmf 3.3V external A4/A5 I2CDevice  
Netduino Plus 2 netmf 3.3V external SDA/SCL I2CDevice 4
Panda II netmf 3.3V on board D2/D3I2CDevice  
FEZ Cerbuino Bee netmf 3.3V external D2/D3 SoftwareI2CBus 5, 6
Netduino Go Shield Base (Standalone) netmf 3.3V internal A4/A5 SoftwareI2C 7
 
Notes:
1. jumpered D20/D1 pins to D2/D3
2. JP6/JP8 jumpered to RG3/RG2
3. custom board used to adapt the Mini to Arduino form factor
4. jumpered SDA/SCL pins to D2/D3 or A4/A5
5. hardware I2C pins on Cerbuino not available to shields so using software method
6. WARNING: RESET/A1/A4 are not 5V tolerant on the Cerbuino.  I could have damaged the Cerbuino if I had used different SDA/SCL jumper settings on the EEPROM shield.
7. waiting on a fix from Secret Labs so can use I2CDevice
 
I was able to successfully access the EEPROM using all of these platforms.  The Arduino and chipKIT boards use Arduino and Arduino compatible IDEs.  The .NET Micro Framework (netmf) boards used either the included support for the I2C hardware lines, or in a couple cases had to use either included or added software drivers.  The upside of the software drivers is that the wiring is more flexible and can use CPU internal pullups, but the downside in this case is the software drivers are slower than hardware drivers.  It is recommended to use the hardware drivers if you can, but there are also software drivers available that work for all these platforms (Arduino and netmf).
 
The circuit was designed on the fly to quickly get up and running with I2C.  There are a few changes I would make to improve this circuit.
  1. Remove the 3.3V pullup options.  These were not needed.
  2. Add jumper for switching the entire circuit between 3.3V and 5V.  The EEPROM can run at lower voltages, and this would allow the shield to be compatible with non-5V tolerant platforms like the Arduino Due.
  3.  
Schematic

Saturday, October 13, 2012

USB RS-485 Adapter Surface Mount Boards

The surface mount PCB version of my RS-485 adapter recently arrived from overseas.  This one is cheaper and cleaner using the 20-pin PIC18F14K50, mostly surface mount parts, and fewer LEDs.  These require more patience to build than the through hole version.

I like the expansion ports on this one.  They are Arduino-esque, with power rails opposite data rails, allowing good stability of possible shield expandability.  Every data pin, including the ones used for RS-485 are drawn out to pads. 

Jumpers are provided to choose whether to connect the RS-485 read enable and drive enable lines from PORTB or PORTC.  This allows for varied resource allocation depending on the other I/O used.  If PORTC is completely free, it can be used as a full 8-bit I/O port.  Otherwise SPI can be used.
 
The first board I built out has the headers, and a Beau Interconnect (now Molex) terminal block socket with detachable screw terminals socket.  The second board built has dedicated screw terminals and no headers for a cleaner look.
 
If you look closely, you can see the green wire work done on the first board due to me stripping a pad of one of the capacitors while trying to replace an incorrect value capacitor.  And I originally built the first one with a 4MHz crystal before reading the datasheet and realizing a 12MHz or 48MHz crystal are the only ones that work for USB with this cpu.  I was able to remove the wrong crystal using two soldering irons, and then replaced it with the 12MHz crystal after another order from Digi-Key.
 
Next step is to load these with the Microchip USB HID bootloader, write up some documentation, and start selling some on eBay.