Saturday, March 31, 2012

7 Segments display on my Spartan

I decided to start my VHDL review with the 7 segments display controller for the Spartan 3 FPGA Board. I have to admit that I cheated a little bit and reused most of the original code I used for my class. I just added a little extra functionality and comments to my code. Before I post the code, let's review the way this 4 digit display works.

Now, you may have thought there should be 7 signals to drive each of the 4 digits and 4 for each of the possible decimal points, a total of 32. However, there are only 12 signals that control the display: 7 for the segments, 1 for the decimal point and 4 to select which one of the 4 digits is active. This is a clever way to save 20 inputs and adds just very little difficulty to the implementation. Because of this, only one digit can be on at a time. So... how come we see all 4 on? It's just a matter of turning them on and off in a cycle so fast that the human eye won't notice when they're off. If we slow down the cycle enough we can see it:

Display slowed down using a 26 bit counter


The way I have adjusted the speed of the cycle is by making a counter large enough (16 bits for the final version) so that the 2 most significant bits take a while to change when the number is being increased by one every clock cycle. Those two bits are the select signals for the multiplexers that pick one of the digits and its value to display. I tried to see what happened if the counter was smaller and noticed that the digits started to get all blurred together. After fixing that, I took a picture of the working display:

"Finished product"



I almost forgot to mention: all the signals for the display are "Low asserted", which means that "ON" is 0 instead of 1 and "OFF" is 1 instead of 0.

Finally, HERE is the VHDL code and its corresponding .ucf file(the one that matches the signal names to on the code to the board signals.

Tuesday, March 27, 2012

Ready, set, go!

Today I finally got in the mail the equipment I am going to be using for my little beginner's projects and I am so excited!!! My school renewed some of the equipment in the digital lab and sold the old FPGA boards for a very tempting price and I couldn't resist. Here's what I got:


I had to get a power adapter for the board and a parallel port for my computer but I can start downloading my little baby steps now. I also got a little Teensy++ USB development board. That one I got because I was originally intending to use it for a project that a friend from business school asked me to joint but when the team decided to go on a different direction I was already very interested in learning how to use it so I bought it for myself. Here's a picture that shows how tiny and cool (at least for me) this thing is:



And finally, as I was browsing the web looking for projects I stumbled upon a little infrared remote and receiver and bought them as well. Yeah, I wish I were not a poor student, then I could buy more stuff I don't know how to use (yet). And yes, I also took a picture of that:


In the end, I still don't know what I am going to do with all this but in the meantime I will lean how to program Teensy, start reviewing my old Lab files to get my VHDL skills back and will be posting my progress regularly. Maybe I can come up with a larger project along the way. For now, it's time to go to bed.

Monday, March 26, 2012

Text in forms disappearing on Adobe Acrobat

I just ran into an interesting issue at work. User 1 sent a PDF form to User 2. When User 2 was done and sent it back, User 1 could not see the text entered in the form unless she clicked on the field and then it would only show that field.

Turns out that this is a know problem with PDF form filled on Mac OS X. Someone smarter than me made a fix, here it is:

Windows Vista (And I tried it on 7 and it works):


1. Download this script
2. Close Acrobat
3. According to your operating system, copy the downloaded script on the corresponding location:
  • Windows XP: 
         C:\Documents and Settings\USERNAME\Application Data\Adobe\Acrobat \9.0\JavaScripts

  • Windows Vista (And I tried it on 7 and it works): 
         C:\Users\USERNAME\AppData\Roaming\Adobe\Acrobat\9.0\JavaScripts

  • Mac OS X:
         /Users/USERNAME/Library/Application Support/Adobe/Acrobat/9.0_x86/JavaScripts

4. Open Acrobat
5. On the "Edit" Menu, click on "Fix Field Appearances". Done!

Note: The path is for Acrobat 9, but I tried it on Acrobat 10 and still works, at least on Windows 7.

Al credit goes to the smart dude who made the solution. Here's where I found it.

Sunday, March 25, 2012

Computacion con manzanitas

Estaba muy emocionando platicando con mi mujer acerca de mi primer y unico blog (este) y se nos ocurrio que  una seccion podria ser dedicada a compartir principios sencillitos de computacion para aquellos que tengan la curiosidad de aprender. A diferencia del resto del contenido este sera unicamente en EspaƱol, con el objetivo de que tanto mi mujer como otros que se sientan mas comodos en este idioma lo aprovechen mejor.

Dicho esto ahi van mis dos primeras grandes sugerencias para aprender a sacarle mas jugo a la computadora:

  1. No tengas miedo a descomponerla: Es casi imposible echar a perder la computadora simplemente moviendole a los programas y picandole por aqui y por alla. Aunque es posible dejar la computadora inutilizable por un rato y requieras la ayuda de alguien mas experimentado, solo el danio fisico puede llegar a ser irreparable. Mientras no la eches al agua o la agarres a martillazos todo estara bien.
  2. Siempre ten una copia de seguridad de tus archivos: Utiliza alguna memoria externa a la computadora para guardar un respaldo de tus archivos, de esta manera en caso de robo o perdida total de la informacion en la computadora no pierdas para siempre tus fotos, musica y documentos.

En el futuro publicare en este blog algunas "Definiciones marca Pey" para ayudar a entender esos conceptos que a primera vista se ven complicados. Solo es cosa de perderle el miedo y darse cuenta que es mas facil de lo que parece.

Friday, March 23, 2012

Dual boot Mac and domain logon problem

Yesterday something reminded me of a stupid problem I had last year. I am one of the administrators for a computer lab at school and during our big yearly re-image and update of he computers I noticed I was having problems logging in after putting them on the school's domain.

The problem was that after adding the computer to the domain on the Mac side, once I tried it to add it on Windows side the "link" would be messed up and since we were using a domain account to log in, we were stuck with just the local account.

The solution/workaround was to remove the workstation from the domain (both at the workstation and the Active directory Users and Computers list) and then add it on the Windows side FIRST and then on the Mac side.

I don't know if an update or the IT people have solved this little issue yet but I document it just in case anyone comes across something similar.

Thursday, March 22, 2012

Outdoors!!

So, I am taking and  outdoors recreation class (I needed something easy to balance my load this semester and that was the only thing I could get) and we went to a rope-climbing-course-thing-place. No mames! Now every single muscle in my body is sore. But it was awesome! I am starting to realize there is cool stuff outside of my cave (not that there is anything cool here anyway).

BTW, I had noticed it before, but today I found more evidence of my aversion to sunlight:


This picture was taken at noon. The door at the bottom is the bathroom, guess which one is La Cueva del Pey.

Wednesday, March 21, 2012

I have a midterm, I have a midterm...

Yeah, but it is easier to get distracted and start a blog that will probably die in 2 weeks. If you happen to be one of the < 10 people who will visit this blog, here's a few DISCLAIMERS:

  • This is my first blog ever, it was never intended to be a good blog, it's probably lame and I'm OK with it.
  • I'm Mexican: You will find Spanglish and/or Spanish. 
  • I used to be obsessed with spelling but I don't care about it or grammar anymore. (Pero nuunk boi a ezkribir asii, m kstra la gnte k lo haze!!!) 
  • No tengo "Enie" ni acentos en mi teclado y me da hueva solucionarlo.
  • I might (highly super most pinche likely) use inappropriate language 
I might add more to that list eventually.

And now, let's get started with this "blogging" thing.