Wednesday, September 28, 2011

PSoC3 Custom Board - Second PCB

Many small changes and revisions later,I've got the 2nd version(Rev 5) of the PCB ready.
Changes include
-addition of a 3.3V Power regulator and a power level selection jumper.
-Ext DC Power Source connector.
-widened all power tracks to 40mils.
-shortened USB tracks,since long high speed tracks add noise.
-added a 5 pin power header(Vin,Gnd,Gnd,5 and 3.3V).
-added an external pullup to XRES,since the internal one is weak.
-fixed the header alignment.
-and a few other routing and placement errors.
Below is a board view:

and here it is rendered in 3D:

-Work on the silkscreen
-Decide on the ground plane
-Make it production ready.(DRU)

Drop a line in the comments if youre interested in the PCB files.

Friday, September 23, 2011

PSoC3 Custom Board - First PCB

I've tried to adhere to the "rules" of mixed signal design,and the guidelines in the Datasheet,regarding decoupling capacitors.However,I'm not able to conclusively decide where the ground planes should be.(Since theres no "exclusive analog half" and "exclusive digital half".Its more like digital(USB part) then analog(VDDa and Port 1),then Digital again(remaining right half of the board)..
Below is a shot of the board with VDDa and VDDd highlighted,to show you the digital and analog sections of the board..

Drop a line in the comments if youre interested in the PCB files.

Thursday, September 22, 2011

PSoC3 Custom Board - First Schematic

So,heres the first schematic.
A few points -
1.I've blatantly tied VDDd and VDDa together,at the VBUS of the USB port.I think I'll be changing that very soon.
2.Same for VSSd and VSSa.
3.Also,except for maybe a voltage regulator for the 3.3V level,I'll stick to this.
4.This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

If youre interested in the PCB files,drop a line in the comments.

Wednesday, September 21, 2011

PSoC3 Custom Board - Hardware Revisions

Though I havent started on the first revision,I'd like to get my ideas out before I forget em :P

Initial Design -5V operation,power source USB,USB Bootloader,SWD header.
-There,I've decided the power system too. :)

Rev1 - 5,3.3V operation,Power source USB & External DC Jack as well as a "VIN",USB Bootloader,SWD header,JTAG solder-on header.

Other general Ideas I'd like to add,
-"Shields" for the Board.(Yeah,I know.Need to find a name for this design.)
-Have part of the IO pins at 5,and a part at 3.3,and remove the concept of everything at one IO level.
-More as they hit me.

So what are my plans with this?
Well,I'd like to allow fellow students like myself,a chance to purchase one of these.(No,I dont look at this as a money spinner.Thats not my current focus.).The simple reason being,that'll allow them a better chance to learn this stuff,especially if their college or institute doesn't have the required setup for such an opportunity.Plus,I hear sad stories of very poor lab access from my friends in other colleges,something which I too am deeply frustrated about.

I'm not creating an Arduino killer,but something that can be easy to use,and yet very powerful at the same time.I mean,I see the Atmel and Microchip series of MCUs,while I've not used the latter,I find the PSoC3 way better,but not so accessible.Also,I really want to go further with the PSoC,but I need some hardware too :)

PSoC3 Custom Board - Bootloading

This was a part that,in my opinion is the weakest link,and yet the crux of this design's philosophy.But,like I mentioned earlier,Cypress has some ground work in this direction,which encouraged me to go forward with this on the first place.Links to that below:

PSoC 3/5 Creator Bootloader Overview Video

AN60317 - PSoC® 3/PSoC 5 I2C Bootloader (video,code and documentation.What more do ya want?)

After going through the 2 sources,I must say I was impressed at the simplicity of the whole process.Great Job Cypress!

I'll detail this further as I do it first hand.

Update : 15 Dec 2011 : With PSoC Creator 2.0 available for general access,the USB Bootloader has been included as a code example for the USBFS component.I gave it a spin on a 001 kit,and it works brilliantly :-)

Tuesday, September 20, 2011

PSoC3 Custom Board - Schematics

The schematics are the first real design I've done for this project.Based on the reference design(in the datasheet),I've come up with a basic schematic for the design.I'll post it here after I figure out what power level I want to go with.

(A recap of the power dilemma, Which Source? - USB,DC Power Jack,Header ..all 3 ? and Which Power level? 5,3.3 or a custom level? ..all 3?)

About the USB connections,whats the simplest way,while not abusing specs? I've seen a range of designs,some with direct connections,some with just resistors on the D+,D- lines,while most use the 3.6V zeners too.But all production level designs(the PSoC kits,mbed and more) use USB Transient suppressors(like the TI's SN65220) chips with some more passive parts.

While that does sound exotic to me,its there for a solid reason.Again,I find myself torn between keeping it simple and cheap,and doing the right thing.

Update 21/9/11 - Based on U2's inputs on the cypress forums,I've added only 2 22ohm resistors on each of the D+,D- lines since the PSoC has an internal regulator to stick to 3.3V on them.

PSoC3 Custom Board - Prototyping

So,with design goals and the parts decided,its time to prototype the design.

This being a 48pin SSOP chip,needs a breakout board which can be plugged into a breadboard.That done,I'll wire up the required caps,as in the Datasheet,and connect a MiniProg3 to burn in the bootloader via SWD,and then try burning a program in via USB,and wait for the blinky.Thats the rough order of events for this phase of the design.(I wonder how the pros do it...)

Before I started this,I was pondering about going to PCB stage directly,since its a straightforward design(there,I've jinxed it.).A chip,caps,a regulated supply and a 2 wire programming header.Still pondering.Any suggestions?

So far,the breakout board is done(with help from my friend Arup Basak) and heres what it looks like.
 The PCB design was made in Fritzing,since they already had a 48pin SSOP footprint that I could use.After I finalized the design,Arup etched it for me.(Update - Eagle has it too,its in the BurrBrown library.)

If youre interested in the pcb files,just leave a comment below stating the same.

 I opened a tech support ticket with Cypress about this project of mine,for which I got a really encouraging response,some interesting points,and samples of the required chip.

I'll solder the chip on,and wire the caps according to the schematic.

The next post(s) will describe the schematics involved.

PSoC3 Custom Board - Design Goals

With this design,as decided,the idea is to keep it simple and low-cost for the end user.

It'll have 3 main parts,

1.The PSoC3 Chip:
There are 2(+1) variants,the 100pin TQFP and the 48pin SSOP(and the 68pin QFN),which have some feature differences,with the 100pin TQFP CY8C3866AXI-040 being the big daddy of 'em all.

While bigger is better,the SSOP part I had chosen initially satisfied my goals.That was the CY8C3866PVI-070(check the PSoC3 parts available at Cypress' Part Selector).I switched to the CY8C3866PVI-021 later,and more on what prompted that change.
So,the final choice for the chip is the CY8C3866PVI-021.Over to programming now.

2.The Programmer:
Now while the PSoC3 supports SWD(Serial Wire Debug) and JTAG for burning your code,both these modes need an external programming setup of some kind.The First Touch Kit has an FX2LP chip doing SWD for us,while the bigger boards have a MiniProg3(more on that here) supplied to do both(and also act as an I2C bridge,SWV etc.) JTAG as well as SWD.
If you'll goto the MiniProg3 page,an $89 price tag in red is the first thing that you see.Now,I don't mean that its overpriced,but as a student,I cant afford one.(especially when the First Touch Kit itself is $49)

Both programming ways,the FX2LP chip and the MiniProg are complicated(not what I want in my design) and costly.Again,more reference to the Arduino,(which was the source of inspiration for this design.)which uses a Bootloader(the Arduino Bootloader),on an ordinary atmega328(or similar) to simplify the programming.Sure,you need a programmer to get the bootloader burnt on in the first place,but I'll discuss that later.

So,Bootloader it is.Cypress has appnotes for UART(currently under review),I2C(here) and USB(catch my drift?) bootloaders.I didnt know about the USB Bootloader appnote initially,so chose the CY8C3866PVI-070 for my board.Later,realizing the (obvious) advantages of a USB bootloader,which is natively supported(yay!) ,I switched parts to the CY8C3866PVI-021,which is the exact same as the previous choice,but with USBFS(full speed USB2.0).

So the chip is going to be the CY8C3866PVI-021,running a USB bootloader for easy programming.

Now,I havent really nailed down the design goals for this one,but heres what I think.
So,since we'll be using USB,theres the direct access to +5V.Nice.But what about 3.3V? and an external power jack? Or custom voltage levels from external sources(battery,or solar cell etc) ?

While it'd be very easy(for me) to use the USB for power also,it'd be restricting.Okay,so add a "VIN" for connection of any external regulated source.But doesnt that sound a little 'half done'? Fine,add a regulator with jumpers to switch between 5 and 3.3V operation.What about USB v/s an External wall wart adapter for power sources? More jumpers?

That adds a lot of components to the design.But then theres lots of platforms running 5V(Arduino) or fixed 3.3V(mbed,I think.) and still considered "user friendly".

Need to come to a final choice for this.

Update: 29 Nov 11: So the power section is frozen,with 3.3V and 5V selectable levels,where the 5V comes from USB(only) and the 3.3V can be sourced from either USB,or an unregulated DC supply fed into an LM1117-3.3,depending on jumper config.

Its going to be a chip+power with GPIOs broken out to headers.Low cost,simple to use,simple to re-design for custom implementation.

PSoC3 Custom Board - The What,Why,How

I know,long time nothing.That also means I have a lot to write,so I'll start with the current stuff,and deplete the backlog over time.
Update 18 Jan : Here are some pics of the finished board.

A PSoC3 Custom Board.

A self designed PSoC3 board that is open source,prototyping friendly,low cost and can be used with ease(in terms of hardware).

Apart from the really good learning opportunity this provides,also doing it because I find the PSoC3 First Touch Kit(here) too constrained(specific reference to header layout.) and the DVK(here) too big and costly.Overall,the cons of current kits on offer by Cypress being cost and ease of use.

Also,since I really feel that the penetration for such awesome hardware is minimal among us students,compared to what it can and should be.Again,I'd attribute it to the 2 above factors on their hardware.But that said,CUA(Cypress University Alliance) is a really great initiative.

If people could buy a board for around INR 1000-1200(the Arduino price point),then that'd really open them up to this awesome world,and maximize exposure to *real* embedded systems (Arduino bashing :P )

The basic idea is to replicate the arduino philosophy.By that I mean,chip,power and easy programming,all on one board.Simple to use,hack and modify for custom designs.Aim being to increase ease of use,of which the arduino is an epitome among simple micro-controller platforms.

Since the PSoC3 is no atmega328,this makes this idea all the more interesting,since the power of the PSoC,available at the simplicity of the arduino is a great combo,in my opinion.Thats also my aim for this.

Like I said,Open Source.So all material for this design is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

I'll be detailing the design process as I live it :)