FabLab CALI ... to build almost anything

Embedded Programming

For this week the intent was to get to know a microcontroller, program it and get it to do something. After the many difficulties with the FabISP due to the availability of surface mounting components, and the USBasp which we saw as an alternative since we could get the components in Pdip (throughhole) version but we still require another programmer, we decided to try a different platform. There has been a great experience with PSoC so we give it a try.

PSoC

PSoC stands for Programmable System-on-Chip, a family of microcontrollers from Cypress Semiconductor that include a set of programmable analog blocks making it very flexible and ideal for many applications.


The programming environment is based on C for the routines (although programming directly in assembly is an option) and include a wiring interface in which you drag and drop predefined modules like PWMs, comparators, input/output devices (e.g. buttons, LEDs, displays, etc) and allow you to wire input and output pins, defining the architecture of the system.




The board for the system was done in-house and the schematics and board design can be seen below from the PSoCkeros group from UAO lead by professor John Jairo Cabrera. The only commercially acquired part of the system is the programmer which was available.
 


 

As an extension, a pannel with an LCD, 4 LEDs, and 2 buttons (not soldered yet) was used which is also made in-house, the schematics and board can be seen below. This allowed for quick testing of input and outputs.

 



 



As a demo, a routine was created that exports a message in the LCD "Hello Everyone FabAcademy 2014" and cycles through the 4 LEDs in a sequence. The programming interface made it extremely easy to achieve this, the output pins assigned to the LEDs were defined in the wiring diagram and afterwards it was just a matter of saying LED_1_On() or LED_1_ Off() to turn it on or off respectively. The first try cycled so fast that the blinking was barely noticeable.

 

 

Later, the wait between turning on and off was increased and a much better result was achieved.
 

 


 

Alvaro J. Rojas Arciniegas, PhD

 

Assistant Professor Department of Automatics and Electronics - UAO

ajrojas@uao.edu.co

+57 (2) 318-8000 ext. 11384