sexta-feira, 30 de dezembro de 2011

Building the hardware

Hello dear followers, this post is special for us, the last post of the year, and this show the first test with a small program in the hardware, the famous "Hello World", for this we use the MSP430F2013, a 2X16 LCD, an external 9V , a 5V regulator (LM7805), a 10K trimpot for LCD contrast and several jumpers for connecting the protoboard.

Since we will use 4-bit mode, the LCD must be connected only in their last 4 pins (D4, D5, D6 e D7) plus (RS, command and enable).


For this configuration we have the following electric diagram:



In our case we have the LCD backlight controlled by the timer (LM555), but that's a topic for another post.

Montando o hardware

Olá caros seguidores, esse post é especial para nós, o último post do ano, e neste mostraremos um primeiro programinha já testado com hardware, o famoso “Hello World”, para isso usamos o MSP430F2013, um LCD 2X16, uma fonte externa de 9V, um regulador de 5V (LM7805), um trimpot de 10K para o  contraste do LCD e vários jumpers para ligação na protoboard.
Como utilizaremos o modo de 4 bits do LCD devemos ligar apenas seus últimos 4 pinos (D4, D5, D6 e D7), além do (RS, comando e enable).
Para esta configuração temos o seguinte esquema elétrico:




No nosso caso já fizemos o backlight do LCD controlado pelo temporizador (LM555), mas isso já é assunto para outro post.


Feliz 2012 a todos!!!

domingo, 25 de dezembro de 2011

Programming the hardware

Hello dear followers, in this Christmas post we will finish our first program on the board using the hardware MSP430. For this we will use the libraries already created in the last post and now will do our "main.c".

The initial proposal is to print the code on the LCD "Hello world", is quite simple to test if the LCD is alive, so we created a vector of characters, of course do not forget the watchdog before, otherwise he will bark.

Now initialize the LCD, star the infinite loop to print the vector elements and the end command to jump go to the starting position.
So we have :
int main(void)
{
   WDTCTL = WDTPW + WDTHOLD;  // Stop watchdog
  unsigned char i;
  char Vet[12]="Hello World";
  InicializaLCD();   //Configution
  for (;;)   // Start infinite loop
  {
          for(i=0;i<11;i++)
      {
         EnviarDados(Vet[i]);
      }
         EnviarComando(0x80);    //Initial position
  }
}

The code can also be found here.

Running the LCD will show the message this way:


Okay, we already have our program running on the MSP430, the next post will show how to set up the circuit.

sexta-feira, 23 de dezembro de 2011

Hardware libraries

Hi, after a time we come back in this post to develop our hardware libraries of our project with the MSP430F2013.

First we will test the “Hello World” in the LCD, using 4 bits, this will give us some  trouble .
Then we will create a library “basico.h” that it has basic functions for any program that we will use:

// bit functions
#define BitSet (arg, bit) ((arg) |= (1<< bit))
#define BitClr (arg, bit) ((arg) &= ~ (1<< bit))
#define BitFlp (arg, bit) ((arg) ^= (1<< bit))
#define BitTst (arg, bit) ((arg) & (1<< bit))

Now we will create our “lcd.c”, this will make all the operations for functions to facilitate our LCD use.
Starting for delay, for we start the LCD, it needs a time before receiving commands, for this we will create an expend  time, using Loop, minor of 40us and a greater of 2ms, that uses the one of 40us.

In the boot function we configure the direction of the terminals with BitSet, we use the delay, and we send the commands of 4 bits 2 lines, incremental  mode, blink, to erase the display, and to order to the initial position.

To send command we create a function that catches the command of 8 bits, makes bitshift of 4, orders to read 4 and later the others 4. Already
to send data is practically the same thing, only that at  the beginning instead of use BitSet (P1OUT, RS) we use BitClr, that is the data mode.

Finally we have the dumb function that the position of the line, for sends command.
Thus, finally, let us create “lcd.h”:

#ifndef LCD_H
#define LCD_H
void Delay40us (void);
void Delay2ms (void);
void EnviarComando (unsigned to char cmd);
void EnviarDados (unsigned to char value);
void InicializaLCD (void);
void MudaPosicao (unsigned to char lin, unsigned to char col);
#endif

All the libraries can be found in our site
clicking here.
With this, the libraries are read, we will to create the in the next post.

Until soon!

sexta-feira, 16 de dezembro de 2011

Programando o hardware

Olá caros seguidores, nesse post de Natal terminaremos a programação do nosso primeiro programa para embarcarmos no hardware usando o MSP430. Para isso usarmos as bibliotecas já criadas no último post e agora faremos nosso “main.c”.
A proposta inicial é imprimir no LCD o código “Hello world”, é algo bem simples para testarmos se o LCD está vivo, para isso criamos um vetor de caracteres, claro não se esqueça do watchdog antes, senão ele vai latir.
Agora inicializamos o LCD e abrimos o loop infinito para impressão dos elementos do vetor, ao final enviamos comando para ir para a posição inicial.

Assim temos:

int main(void)
{
   WDTCTL = WDTPW + WDTHOLD;  // Interrompe o watchdog

  unsigned char i;
  char Vet[12]="Hello World";

  InicializaLCD();   //Configuração
  for (;;)   // Inicia loop infinito

  {
          for(i=0;i<11;i++)
      {

         EnviarDados(Vet[i]);
      }

         EnviarComando(0x80);    //Posição Inicial
  }

}


O código também pode ser encontrado aqui.


Funcionando na plaquinha a mensagem ficará dessa forma:



  
Pronto, já temos nosso programa montado para rodar no MSP430, no próximo post mostraremos como montar o circuito.


Feliz Natal a todos!

sexta-feira, 9 de dezembro de 2011

Bibliotecas para o hardware


Olá, caros seguidores, após um tempo fora voltamos nesse post para desenvolver nossas bibliotecas para o hardware do nosso projeto com o MSP430F2013.

Primeiramente iremos testar o “Hello World” no LCD, usando 4 bits, isso nos dará um pouco mais de trabalho.

Criaremos, então, uma biblioteca “basico.h” que tem funções básicas para qualquer programa que iremos utilizar:

//funções de bit
#define BitSet(arg,bit) ((arg) |= (1<<bit))
#define BitClr(arg,bit) ((arg) &= ~(1<<bit))
#define BitFlp(arg,bit) ((arg) ^= (1<<bit))
#define BitTst(arg,bit) ((arg) & (1<<bit))



Agora criaremos nossa “lcd.c”, esta fará todas as operações por funções para deixar mais fácil utilizarmos o LCD posteriormente.

Começando pelo delay, para inicializaremos o LCD, ele precisa de um tempo antes de receber comandos, para isso criaremos um gasto de tempo, por loop, menor de 40us e um maior de 2ms, que usa o de 40us.

Na função de inicialização configuramos as direção dos terminais com BitSet, damos o delay, e enviamos os comandos de 4 bits 2 linhas, modo incremental, blink, apagar o display, e mandar para a posição inicial.

Para enviar comando criamos uma função que pega o comando de 8 bits faz o bitshift de 4, manda ler 4 e depois os outros 4. Já para enviar dados é praticamente o mesmo esquema, só que no início ao invés de dar BitSet (P1OUT,RS) damos BitClr, que é o modo dados.

Por fim temos a função que muda a posição da linha, por envia comando.

Assim, por último, criemos a “lcd.h”:

#ifndef LCD_H
                #define LCD_H
                void Delay40us(void);
                void Delay2ms(void);
                void EnviarComando(unsigned char cmd);
                void EnviarDados(unsigned char valor);
                void InicializaLCD(void);
                void MudaPosicao(unsigned char lin, unsigned char col);

#endif

Todas as bibliotecas podem ser encontrada no nosso site clicando aqui.


 Com isso já temos as bibliotecas prontas, o programa iremos criar no próximo post.

Até logo!

sexta-feira, 7 de outubro de 2011

Creating the Gerber files


 Hello dear followers, today to finish our clock layout with the MSP430-F2013 we will create the gerber, group of files that are sent to the company that the poster will be printed circuit.
First go into Options, Post Process Settings in this window click on the lines of all options with bottom and in the new window uncheck "Enable for post processing", leave this option checked only for (TOP, SMT, OSH, AST, DRD). Done this go on Auto, and then click Run Post Processor, Orcad now must create in the directory of file open multiple files from gerber as (name.TOP,.OSH,.SMT,.GTD,. DRD,.AST, .lis,.DTS and TRUEHOLE.tap)




To help us visualize the gerber as prints we use some program, where we'll use the Viewplot (R), which is free and can be found here.
Opening the program, load the generated file name.TOP ", and will appear something like this:





Done! Now we have went  through every part of the project and hardware specification, creation of schematic and layout. We have then a project halfway finished.





Hey, look at the day and time of the post!


sexta-feira, 30 de setembro de 2011

Gerando e visualizando o gerber

Olá caros seguidores, hoje para finalizar nosso layout do relógio com o MSP430-F2013 iremos criar o gerber, grupo de arquivos que são enviados para a empresa que confeccionará o circuito impresso.
Primeiramente vá em Options, Post Process Settings nessa janela clique nas linhas de todas as opções com bottom e na nova janela desmarque a opção “Enable for post processing”, deixe essa opção marcada apenas para (TOP, SMT, SST, AST, DRD). Feito isso vá em Auto e clique em Run Post Processor, o Orcad agora deve criar no diretório do arquivo aberto vários arquivos de gerber como (nome.TOP, .SST, .SMT, .GTD, . DRD, .AST, .lis, .DTS e TRUEHOLE.tap)



Para visualizarmos o gerber como será impresso temos que usar algum programa, no caso usaremos o Viewplot, que é gratuito e pode ser encontrado aqui.
Abrindo o programa, carregue o arquivo gerado “nome.TOP”, e aparecerá algo como:



Pronto agora passamos por toda parte de projeto e especificação de hardware, criação do esquemático e layout. Temos então um projeto a meio caminho andado.

sexta-feira, 23 de setembro de 2011

Creating the copper pour


We return again with the layout, but now is part of the final finishing.
First let's get the texts at silk screen (OSH), with the Text Tool selected, we should remove the unnecessary names and adopt a pattern of provision, for example only to the right and upon, except a few exceptions in that you cannot place in appropriate niches.
Now let's add a fill layer copper, associated with the mesh of the Earth, to provide protection in case there is something in short this is grounded, in addition it also serves to filter out possible noise. So with Obstacle Tool make a rectangle on the entire plate and click on the edge by selecting New in Obstacle Type select Copper pour, in Width and Clearance put 0.5 and Net Attachment select 0 (GND), click OK.





The program will render the fill and superimpose all land lines, connecting the pads by small filaments only. Then the appearance of the layout should be this:






In the next post, we'll show you how to generate and view the gerber of our layout to the design of the clock with the MSP430-F2013.

sexta-feira, 16 de setembro de 2011

Criando o Copper Pour

Voltamos novamente com o layout, mas agora é a parte de acabamento final.
Primeiramente vamos arrumar os textos em silk screen (SST), com a Text Tool selecionada, devemos remover os nomes desnecessários e adotar um padrão de disposição, por exemplo somente à direita e  em cima, salvo algumas exceções  em que não é possível posicionar nos devidos nichos.
Agora vamos adicionar uma camada de preenchimento de cobre, associada à malha do terra, para prover proteção caso haja algo em curto este será aterrado, além disso serve também para filtrar possíveis ruídos. Assim com Obstacle Tool faça um retângulo na placa toda e clique na borda selecionando New, em Obstacle Type selecione Copper pour, em Width e Clearance coloque 0.5 e em Net Attachment marque 0 (GND), clique em OK.




O programa irá renderizar o preenchimento e sobrepor todas as linhas de terra, conectando-se aos pads por pequenos filamentos apenas. Então a aparência do layout deverá ser essa:



No post seguinte, mostraremos como gerar e visualizar o gerber do nosso layout para o projeto do relógio com o MSP430-F2013.

sexta-feira, 9 de setembro de 2011

Routing the board


Continuing the confection of the layout we will now move on to the Board routing the MSP430-F2013.
First, we must create a barrier that will limit the area of the plate with Obstacle Tool. Now let's position the components with Component Tool, as a convenience for the best routing, watching the links so that there is less junction of routes. If you do not have patience to make a hard manual work and want to automatically route, you must first go into OPTIONS, Route Strategies, Route Layers and disable all icons with the Botom. Will now have to go in AUTO, Autoroute, Board. Otherwise click the button "add/edit mode" and draw the trails starting from part of signup, after feeding. Remember that automatic routing is a quick solution for routing only, it is strongly recommended to do manually for the the better use of space.
If you're hardcore and will do it manually start by developing digital signal extends from MSP and after passing to the analog. Finally do the routing of Vcc and GND, remembering that if you reach a point where spare some vi to be linked, but it is not possible to do without crossing other tracks, you can add a jumper, just add a resistor in the Schematic Capture.
To update the layout where there has been some change in the schematic, one should keep open the Layout Plus and the Capture, this should go on Create Netlist and select "Run ECO", returning to this layout should ask to update automatically.
To add a footprint created an existing component you must right-click on the component with the Component Tool button and select Properties and then Footprint in new tab choose the desired footprint.


Then we should have a layout as below: