Saturday, June 8, 2013

Experimenting with MyHDL

MyHDL is a very good tool to convert python code to VHDL or Verilog. It can encapsulate a user from writing VHDL and Verilog codes. Since I am using Python for years, I opt to reuse it instead of learning VHDL or Verilog. Just to share, I tried to create a simple project using Altera Quartus as an experiment.

Here is a simple code in python.

The output in VHDL is here.

The resulting RTL from Quartus:



I was impressed because MyHDL is smart enough to recognize if a pin is used as an output or input.

Sunday, February 17, 2013

Repair: Weird clicking sound on Zoom G2.1NU's Pedal

Did you hear some clicking sound when you use your G2.1NU's built-in expression pedal? If yes, stop using it. Investigate. There is a possibility the the potentiometer inside is hitting the end of its wiper when the pedal is pressed and unpressed. This will limit the gear inside. Worse, it could the damage the gear and potentiometer inside.

I had this problem this morning and this is how I solved it.

Remove all the screws.
Open the case until you see the electronics boards inside.
Encircled in red is the potentiometer's location.


Remove the two screws to loosen up the potentiometer and the gear


Readjust the gear of the potentiometer.Do a trial and error until the clicking sound disappear.
Reassemble the unit.
Do a pedal calibration. Press and hold "Pedal Assign" thne on the unit.
Plug in your guitar.
Enjoy.

Wednesday, June 13, 2012

CC430: Wireless Development (on-going) Adventure

CC430 is a very great microcontroller. The inclusion of the RF is a big plus. I am currently using this in my project. This uses CC430F6137.




The installation CD contains sample codes for the Chronos Watch. I reused some of the CCS RF codes from the Chronos CD to be able to get started quickly and did some improvements on the codes. For evaluation and range testing, I used Smart RF Studio to test some packet transmission but I am having problems receiving packets of data(using Smart RF Studio in receive mode). Instead, I used another TI's development board with a full JTAG connection (not Spy-Bi wire as what was implemented in the Chronos watch) to be able to receive the data.

I am also communicating to another device which is not a Chronos watch and I used Synchronous mode (since they have a very different preamble and sync word) with Manchester decoding/encoding. I learned this from CC1101's sample codes (it looks like an old code - it has the name ChipCon) - this can be downloaded also from TI's website.

If you will be needing source code samples for:
1. Less than FIFO (fixed packet length)
2. Less than FIFO (variable packet length)
3. Greater than FIFO (variable packet length)
4. Greater than FIFO (fixed packet length)
5. Asynchronous mode
6. Synchronous mode
you need to download this from TI's website as this is not included in the Chronos CD.

Since a customized wireless bootloader update is included in my project, I was forced to use IAR Kickstart (free version) since the sample bootloader code provided is written only in IAR.

Learning CC430 (especially the RF portion) is a little bit challenging at first but as I progressed, I encountered a lot of "Aha" moments. :D

Saturday, July 2, 2011

Fez Panda II... First Run



Fez Panda II is a very great way to learn .NET Micro Framework which is surprisingly open-source . All of the tools needed to develop firmware application for the Fez Panda II are free from the Internet.

On my initial experiment, the creation of Led Blinker, SD-Card accessing, up to multithreading was simplified by the .NET Framework. I recommend to have a good reference C# book as Fez Panda II uses C# as its main language.

Using C# as its main language has so many advantages. There are a lot of references on the Internet. Back then, I was hoping to be able to use C# in embedded systems development. Using C is very good in small systems. But when the program gets very huge, C becomes a double-edged sword. Used rightly, C# will be able to surpass design problems presented by C.

I just hope that Microsoft .NET Micro Framework will live forever, will be supported by the embedded community and will be available to different microcontrollers in the future.

Friday, February 18, 2011

PyScripter: A very good lightweight Python editor.

I am searching for a very good lightweight Python editor. I saw PyScripter, tried it, and fell in love with it. :)

Parsing XML with Python using ElementTree (link)

I am searching for Python XML parser and most of the codes that I had seen today contains lots of code. I saw a very good solution from this blog.

I had some slight modifications. Here is a fully working code.

Thank you so much Troy Grosfield.

Friday, February 4, 2011

What is the best programming language to start with?

Around 2003, I have a friend who would like to learn basic programming and asked me if I could teach him some basic stuffs for novice. I tried to teach C, but it took me time to explain the code line by line from the start up to the end of the source code (like Hello World with some computation):

#include < stdio.h >

int main(void)
{
int a,b,sum;
printf("Hello World!\n");

a=2;
b=5;
sum=a+b;

printf ("2 + 5 = %d\n",sum);

return 0;
}



Around 2008, I have a friend who wants to learn programming and I started to teach Python. Using the same goal above:

print "Hello World"
a=2
b=5
sum=a+b

print "2 + 5 = ",sum


I took less time explaining this Python code than with the previous C code.

Personally, I am in favor of using Python instead of C to those who wants to learn basic programming even at schools or universities. Python is a very good starting language and I am using this language since 2007.