Saturday, April 30, 2011

PSoC 3 FTK - Prototyping friendly

The PSoC 3 FTK has a 28 pin DIP IC socket compatible pin layout below.While this can be inserted into a breadboard for prototyping,it covers a lot of breadboard area.


A few ideas to make it more prototyping friendly,

1.Replace the existing simple male headers,with double height ones,allowing access to them from the top as well as below.Though,this would then render the Wireless CyFi port inaccessible..So then, maybe half of the pins could be double height ones.

2.Make a Dev Board : Make a board with basic peripherals,like a 5 & 3.3V supply,Level shifing,UART,an LCD,push button switches etc and all the pins broken out to female headers,where the PSoC3 FTK plugs on into a 28pin socket on this board.

3.Shields : Just like the Arduino,we could have stack-able shields for the PSoC3 FTK too.I aim to finally make a PSoC 3 shield out of the Ethernet thing.

4.Have a dummy 9v battery holder,mounted face up,to which the Board can be plugged in,making it stand upright,giving easy access to both faces of the board.

I'll have pictures of these,once I have implemented em.But thats a long way right now,as the first thing I need to do,is build a small 3.3v regulated power supply,that can be neatly accommodated onto the FTK's board.

Wednesday, April 27, 2011

Robert Noyce

From the Adafruit blog,

On April 26th 1961, the silicon integrated circuit was patented by Robert Noyce (No. 2,981,877).
Robert (Norton) Noyce was a U.S. engineer and coinventor (1959), with Jack Kilby, of the integrated circuit, a system of interconnected transistors on a single silicon microchip. He held sixteen patents for semiconductor devices, methods, and structures. In 1968, he and colleague Gordon E. Moore cofounded N.M. Electronics, which later was renamed Intel Corporation. Noyce served as Intel’s president and chairman (1968-75), then as vice chairman until 1979.
Src: Today in Science History
It is also worth mentioning this MIT graduate went on to co-found Fairchild Semiconductor and the production of the first commercially practical integrated circuit.

Thursday, April 21, 2011

PSoC 3 Project Ideas

This post just details some ideas for the PSoC 3 that cross my head.
 In no specifc order,I list some ideas I plan to materialize soon :)

0.Port Stuff  from other Platforms - A lot of the designs we see online,can be made simpler,more robust,and powerful,had they been done on a PSoC.This is one game I love to play,i.e use the PSoC to outplay other platforms on their pet applications,in terms of simplicity and elegance of the design,covering speed,power consumption,expected output,whatever,purely using just a PSoC,and nothing else ;) ....anything from an AVR ISP to a PIC based function generator,the PSoC can give them a run for their money :)

1.A LC Meter - Taking inspiration from some existing designs,and the analog power of the PSoC,I think this is a good idea to excercise the analog blocks on the chip.
Build a Tank circuit,with the L,C being added depending on the other quantity being unknown,(if u wanna measure L,toggle a switch to add a C to the tank,the L being an unknown inductance connected in,and vice versa).Send the Tank's output to the PSoC,where a comparator 'square waves' the sine output from the oscillator,and then use a counter to count the frequency of that wave.Since f=1/2*pi*(LC)^0.5,and one of L or C are known already,we can compute the other.

2.A Logic Analyser(& Oscilloscope & Function Generator?) - Power and speed of the PSoC can be put to good use over USB,with this one.This stuff has already been done on other platforms,so that should help.Converting your existing board into a money saving diagnostic tool,is a good pursuit.

3.Embedded Webserver - Something that I'm currently working on,this one has limitless possibilities.

4.A Bus Pirate clone - The bus pirate is a really handy device,and looking at its feature set,making a PSoC version of it,could be a fun exercise :)

5.USB Applications - This is one side Ive not explored,and would love to,but the FTK I have(currently doesnt work :( ...and also cant do the USB bit,since its USB capable pins are routed elsewhere. ).The USBFS component opens us up to plethora of applications.A USB based anything! :)

6.Verilog On the PSoC - Something I knew only recently about,the PSoC can do Verilog.Though I dont know Verilog all that well,the PSoC offers a great chance to change that :)

7.Shields for the FTK? - For the sake of arduino-ism,this could be a neat project in PCB Design :P

8.Wireless Designs - CyFi is a great wireless solution,and throw USB,Wireless together,and the list is already too attractive.All kinds of wireless sensor networks could come to life.

9.UI stuff: Capsense + a GLCD,to make a proper menu driven UI,could be something useful across a whole range of applications.Hell,a GLCD itself holds a lot of room for exploration.

..Lots more to come,as I give them some more thought. :) with the PSoC,lots is the only measure of ideas :P

PSoC 3 - Unrecognized USB Device



Update - It Works!

A rude shock,when i plugged the board back in,between trying to play around with the POV Example,the FTK showed up as an unrecognized USB device.My "Redo" instincts kicked in,and I reinstalled the software(drivers,creator,programmer,..the whole deal).Still no luck.Calming down,I took the problem piece by piece.Cable,Board,PC.Dug out a cable that came with my TI MSP430 Launchpad board,..still the yellow exclamation sign,bearing the grim message.To eliminate the PC,i did the whole install on a friend's VAIO,but the kit refused to co-operate.
Throughout all this,i did notice that the kit was getting power.

A discussion I had with tinman(from the PSoCDeveloper forums) some time ago,did give me a clear picture of what the board had.The PSoC3 chip,the FX2 chip and an EEPROM with a proper USB id,apart from the power circuity and the sensors,capsense,LEDs etc.

Since the power comes on,and the LEDs+Accelero work(POV Display),that section seems ok.Since the PSoC itself is driving them,I'd give it a green too.The shadow of doubt is on the FX2 and the EEPROM. Is it the EEPROM? Did the FX2 chip face sudden death?

Ive opened this to discussion on the PSoCDeveloper forums(here).I pray the kit isnt dead.I was just beginning to love it :'(

Update - 22-04-11 :Is it the EEPROM? In USB designs,this kind of problem is attributed to zeroed values of VID and PID,which in our case are on the EEPROM,a really tiny SMD part at that,making replacement(after reprogamming the VID,PID into the replacement part) impossible without a hot air rework station.

Update - 23-04-11 : As suggested by undesh of the PSoCDeveloper forums,I'll try sniffing the USB traffic to see what goes on.

Update - 25-04-11 : USB traffic,shows no response.Is the chip off? I pull out my trusty multimeter,and the schematics for the FTK.All the places that are supposed to be 3.3V,are 2.4V.The ZLD 0330's Vout,the FX2's Vcc-s,EEPROM Vcc etc. That doesnt look right,but I am no CyPro.I'll head off to bed,4am in the morning.

Update - 25-04-11 : I touch the probes from my LM317 based 3.3v supply to pins 5(Vout) and 7(Gnd) on the ZLD,and reinsert the USB cable,and Bingo!..We are back! :) ..the FTK3 comes up.Looks if like i'll wire in my own 3.3v regulator,then will be able to use it again. :) Thank You God. Rebirth!!

PSoC 3 : Verilog too!

Among its dazzling features,The PSoC 3 can do verilog too.You can create custom logic in Verilog using just a PSoC 3 FTK.

Some Documentation:
Creating Your Own Components
PSoC Creator 113: PLD Based Verilog Components ( a training on demand video)
PSoC Creator Tutorial - Creating a Verilog Implementation
( From the CypressSemi Youtube Channel)

The PSoC just keeps getting awesome-er :P

Great Video Tutorials for the Arduino

Among the vast sea of resources for the widely popular and simplistic arduino,good tutorials for the average newbie,are rare.I recently came across a set of video tutorials by Jeremy Blum.He has put the basics across quite well in a series of 11(so far) videos,that cover more than baby talk about LEDs and motors.Check them out here.

PSoC3 + ENC28J60 : It blinks!

So,having finally worked out SPI communication(at 10Mbits/sec! ),I set about writing the driver for the chip.
So far,Ive been able to make the Status LEDs blink :)

The code,so far.(Its really rough,no safety nets or any slick optimization tricks.)


I'll end this post with a picture of the working setup :


TODO:
    • Compare and Improve the existing Driver code with respect to the EtherShield 1.6 one. 
                Update - 06-05-11 : Done.Awaits testing once the kit is back up.
    • Add UART & LCD to the FTK,using this & this,for debugging purposes.
    • Use the basic Ping/UDP code from Tuxgraphics' "An AVR microcontroller based Ethernet device",and get that to work.
    • Add on higher stuff like Webserver,NTP,DNS etc,using the EtherShield 1.6 code

    Sunday, April 17, 2011

    Random Data Over SPI

    I'm trying to interface a PSoC 3 FTK with a MX25L6406E 64Mb(datasheet) serial flash module.It talks over SPI.
    Heres a pic of my setup:


    Thats the memory module on the right.A close up here:
    I appoached this by writing basic SPI functions,of Sending,and Receiving a Byte.Make a neat .h file of those,and we can move onto the actual read/write operations on the chip.

    To start off,I'm sending it 0x9F(Read ID or RDID Command),and i should get back
    C2,20,17 in MID,DID1,DID2 ( Page 22 of the datasheet),MI is the manufacturing ID,and DID stands for Device Id.

    But for some unknown reason(to me),I'm not able to get the Rx/Tx part properly working.I keep getting inconsistent data.Below are a set of shots showing the received values from each run of the code.

    Most puzzling.Ive posted this issue to the PSoCDeveloper forums(here).

    Will this post updated with my progress.

    19-04-11 : Ive just realised,based on the input from abitkin of the PSoC Developer forums,and the syntax I kept using with the SPI Explorer,that the issue is with the Chip Select Line not being low for the entire time.Will test this out soon. Exams :(

    21-04-11 : Managed to get over the nagging tension of exams,and tried out the code..Turns out,abitkin was right! \m/ Flawless SPI Communication at 10MBits/sec :)

    Thursday, April 14, 2011

    A Quick LCD Hack

    While debugging an ongoing project,an LCD is a great way to know whats really going on inside your code.However,most ordinary HD4470 16x2 Character LCDs run on 5V,and hence arent useful if you're working on interfacing a chip or a sensor that talks at 3.3V.One solution could be buying a 3.3V LCD Panel, but if you'd like to use your existing one,
    then heres a quick hack for you:

    Below is the back of a regular 16x2 LCD Panel
                                                                      (click for larger versions)
    To get it running at 3.3V,short the highlighted R7,by soldering a small bit of wire.
    and u'll have it running at 3.3V :) ..Agreed,the contrast wont be as great,but its tolerable.

    BitBang UDP Packets

    I recently came across this article,which documents a successful bitbang of UDP Packets by an FPGA.Something similar has been done on an AVR too,which can be found here .I'll read up on these and see if I can do something similar on a PSoC :) (A buspirate could be handy here :P )

    Wednesday, April 13, 2011

    Arduino : Pyxis OS

    An OS for the Arduino has been created and is actively being developed,titled 'Pyxis OS'.
    From the creator's website :
    "How would you like to be able to run compiled programs from a uSD drive? Maybe you'd like to create an app that's closed source? Or perhaps you're just looking to display full screen 320x240 bitmaps using the Arduino. If any of those sounds like what you're looking for than Pyxis is the OS for you.

    Composed of 1 core and 5 libraries, Pyxis OS is brimming with capabilities and features. 100% free and open source Pyxis is yours to do with as you please. After nearly a year in development we're proud to present this OS; with it you can put a 8.3 file system on your EEPROM, easily work with LCDs, and of course access a uSD drive with ease.

    Each of the primary pieces of the OS has their own library. PyxisSD for uSD access, PyxisFAT for the EEPROM file system, PyxisPad for interfacing with the ButtonPad, PyxisLCD for communicating with the LCD and Pyxis for the top-level management of all the pieces."

    Another addition to my to-port-list to the mighty PSoC 3

    Monday, April 11, 2011

    IPad into an Oscilloscope - The PSoC 3


    "Oscium has selected the PSoC® 3 programmable system-on-chip for its revolutionary new iMSO-104 mixed signal oscilloscope for iPod touch, iPhone and iPad. The PSoC 3 device in the iMSO-104 seamlessly manages the two-way communication between the oscilloscope and any iOS device via Apple’s proprietary dock connector, and also processes the incoming analog and digital signals."

    ....read the full story here

    The PSoC never ceases to amaze & inspire :)

    Discovering the PSoC 3

    Hi,
    For those of you who want to start out with the PSoC 3 chip,get,
    The PSoC 3 First Touch Kit ,and download the IDE on the same page.

    The cost is definitely worth it! :)

    PSoC Tutorial Series

    Ive really felt great gratitude for people who've written tutorials and shared their knowledge,whatever it was about.Though I too am relatively new to psoc3,I'm going to do a PSoC 3 Tutorial series,the first installation of which will be coming soon.I'll use this blog to document my work,for others to gain from it. :)

    Saturday, April 9, 2011

    twIP - A Tweet sized IP Stack :O

    An interesting thing I chanced upon today, twIP is an IP Stack small enough to fit into a tweet :)
    More from the author's website :

    "twIP is a really, really tiny IP stack, written in 139 bytes of C code - small enough to fit in a Twitter message. Ok, so it is very far away from a real IP stack, but it can do the first task of an IP stack: respond to pings. The entire source code for version 1.1 can be found this tweet (139 characters long - version 1.0 in this tweet, 128 characters long). "

    The page has instructions on making it work too.Great stuff!

    Friday, April 8, 2011

    SPI Explorer - MSP430 Launchpad

    Following my post on the Bus Pirate,here I write about an SPI to UART converter,built using the MSP430 Launchpad.A very useful application for testing new chips or devices,which use SPI.
    More on that,here . Do take note of the bug fixes mentioned on the page,before compiling it.This was originally written in mspgcc,but users have ported it to CCS as well.

    I have used this successfully on many occasions,to interface with my Ethernet module,and a CMOS Flash Memory chip I recently came across.Flawless :)

    A similar device is the I2C explorer,documented here.

    These are must have tools for any embedded systems enthusiast.

    Friday, April 1, 2011

    The Buspirate - A Great Hardware Hacking tool!


    I recently came across a device called The BusPirate.From the creators,Dangerous Prototypes website,

    "The Bus Pirate is an open source hacker multi-tool that talks to electronic stuff. It’s got a bunch of features an intrepid hacker might need to prototype their next project."

    Its basically a PIC MCU,which acts as a UART<=>X bridge,where X any among the many serial communication protocols out there.With many features added(See the full list here.) and a series of firmware revisions,its a really versatile device that has been used for a variety of applications.

    With international shipping,it can be yours for USD 30...looks like a reasonable price to me,considering the ease it provides to your projects.Interfacing will no longer be a headache :) ..

    I'll try porting this,or making a similar device using the PSoC3 sometime...




    PSoC3 + ENC28J60 : SPI Issues

    The Serial Peripheral Interface Bus or SPI bus is a synchronous serial data link standard developed by Motorola.The wiki page here provides a good overview.Even though its a routine affair on most MCUs,each device implements it a little differently,so reading the datasheet is a must.

    As for the PSoC 3,
    It uses the a Tx Buffer(upto x bytes), Rx Buffer(upto x bytes), Control and Configuration registers of I2C/SPI PSoC block, a data register for data shifting, and one or more Pin Port registers,and an Interrupt system associated with the whole setup.

    The ENC28J60(Datasheet) supports SPI Interface with Clock Speeds Up to 20 MHz.It has a bunch of commands for read/write access to the its register bank(a big one at that..refer to the "Memory Organisation" section of its datasheet),and its TX/RX buffers etc,apart from one to reset the chip.

    So,the first step to interfacing with this would be to write a set of functions to handle the SPI comm.Though I did put together some code,it hasnt been very successful yet.(I keep getting only 0x00 back as data)..its been at that state since quite sometime now,since I am yet to receive my PC's harddisk from Seagate RMA Center.

    PSoC 3 + ENC28J60 : The First

    So I'm currently working on a project that aims to interface the PSoC3(??) with the ENC28J0 Ethernet chip.
    I'm using a module I bought from here.
    Not something new,but its an interesting project nevertheless.
    Arduino(with the 'EtherShield') and AVR ports(here)are already out there,so I'm using those as a starting point.So,most of the packet handing code is already laid out.Its the SPI communication with the chip thats giving me issues.
    I'll post the code here soon.