ADSense1

Mostrando postagens com marcador Microcontrolador: PIC. Mostrar todas as postagens
Mostrando postagens com marcador Microcontrolador: PIC. Mostrar todas as postagens

quarta-feira, 20 de junho de 2018

PIC Microcontroller

Bom material em inglês para aprendizagem sobre microcontroladores com foco no PICMicro da Microchip, abordando com mais profundamente a programação assembly focada no famoso PIC16F84.

1) Digital Representation part 1
2) Digital Representation part 2
3) Logic Circuitry part 1
4) Logic Circuitry part 2
5) Logic Circuitry part 3
6) Logic Circuitry part 4
7) Stored Program Processing part 1
8) Stored Program Processing part 2
9) Stored Program Processing part 3
10) Stored Program Processing part 4
11) The PIC16f84 Microcontroller part 1
12) The PIC16f84 Microcontroller part 2
13) The PIC16f84 Microcontroller part 3
14) The Instruction Set part 1
15) The Instruction Set part 2
16) The Instruction Set part 3
17) The Instruction Set part 4
18) Subroutines and Modules part 1
19) Subroutines and Modules part 2
20) Subroutines and Modules part 3
21) Subroutines and Modules part 4
22) Interrupt Handling part 1
23) Interrupt Handling part 2
24) Interrupt Handling part 3
25) Assembly Language part 1
26) Assembly Language part 2
27) Assembly Language part 3
28) Assembly Language part 4
29) High Level Language part 1
30) High Level Language part 2
31) The Real World part 1
32) The Real World part 2
33) One Byte at a Time part 1
34) One Byte at a Time part 2
35) One Byte at a Time part 3
36) One Byte at a Time part 4
37) One Byte at a Time part 5
38) One Bit at a Time part 1
39) One Bit at a Time part 2
40) One Bit at a Time part 3
41) One Bit at a Time part 4
42) One Bit at a Time part 5
43) One Bit at a Time part 6
44) One Bit at a Time part 7
45) One Bit at a Time part 8
46) Time is of the Essence part 1
47) Time is of the Essence part 2
48) Time is of the Essence part 3
49) Time is of the Essence part 4
50) Take the Rough with the Smooth part 1
51) Take the Rough with the Smooth part 2
52) Take the Rough with the Smooth part 3
53) Take the Rough with the Smooth part 4
54) Take the Rough with the Smooth part 5
55) To Have and to Hold part 1
56) To Have and to Hold part 2
57) A Case Study part 1
58) A Case Study part 2
59) 14-bit Core Instruction Set
60) Special Purpose Register Structure for the PIC16C74B
61) C Instruction Set
62) Acronyms and Abbreviations

Fonte: what-when-how
In Depth Tutorials and Information

segunda-feira, 16 de março de 2015

Material sobre o PIC18 (Slides em inglês)

Material do prof. Orlando J. Hernandez, Ph.D., da cadeira de Eng, Elétrica e da Computação do The College of New Jersey.



 
[   ]Chapter 1: Introduction to PIC18

22-Nov-2010 16:19

140K

 
[   ]Chapter 2: Assembly Language Programming22-Nov-2010 16:19223K 
[   ]Chapter 3: PIC18 Development Tools22-Nov-2010 16:19288K 
[   ]Chapter 7: Parallel Ports22-Nov-2010 16:19263K 
[   ]Chapter 8: Timers and CCP Modules22-Nov-2010 16:19326K 
[   ]Chapter 9: Universal Synchronous Asynchronous Receiver Transceiver22-Nov-2010 16:19244K 
[   ]Chapter 12: Analog-to-Digital Converter22-Nov-2010 16:19273K 

quinta-feira, 12 de março de 2015

Curso básico Microcontrolador PIC (baseado no 16F84 e assembly)

Curso PIC

Este trabalho foi desenvolvido em toda a sua parte pelo Professor Adilson Gutierres. O site Eletrônica 24h melhorou a sua navegação. De qualquer forma, qualquer dúvida sobre  o conteúdo deve ser dirigida ao autor do curso. Este curso não será vendido, pois o trabalho pertence ao Professor Adilson Gutierres.


AULA 01: Mplab o que é, e como instalar no seu computador

AULA 02: Configurando o MPlab para usar o PIC16F84-A com um cristal oscilador de 4 Mhz

AULA 03: Primeiro Projeto - Um gerador de onda quadrada

AULA 04: Erros de Sintaxe no Código Fonte

AULA 05: Abrindo um projeto já existente

AULA 06: Usando a Simulação do MPlab

AULA 07: Considerações sobre o MPlab

AULA 08: Microcontroladores

AULA 09: Registros de Controle da CPU

AULA 10: Construindo um Gravador de PIC

AULA 11: Rotinas de Delay

AULA 12: Rotinas de Delay com Timer0

AULA 13: Rotinas de Delay Temporização (teoria e prática)

AULA 14: Fazendo  um LED Piscar

AULA 15: Aplicação de entradas e saídas digitais

AULA 16:^Controlando um display de 7 segmentos

AULA 17
Uso das Interrupções e Sleep

AULA 18: Interrupção de RB0

AULA 19: Conhecendo o WatchDog

AULA 20: Estudando a EEPROM

AULA 21: Display LCD inteligente

quinta-feira, 30 de outubro de 2014

eBook online sobre o PIC16F877 abordando linguagem assembly (inglês)

Este livro é uma coleção de notas de aulas do Prof. Dr. Charles Kim, sobre programação em linguagem assembly com o PIC16F877 e suas aplicações em robôs autônomos, controladores de braços robóticos e outros projetos interessantes.













Capítulos em pdf:

0. Chapter 0: Book Cover, Table of Contents, and Preface

1. Chapter 1Introduction.
3. Chapter 3: Instructions Sets 
4. Chapter 4: Coding Environment 
5. Chapter 5: Serial Communication
11. Chapter 11: Voice Synthesizer Project

12.. Chapter 12: Internal EEPROM Access
13. Chapter 13: CCP Module and PWM
15. Chapter 15: Armatron Control 


domingo, 22 de junho de 2014

Apostila sobre Microcontrolador PIC16F84

Apostila sobre microcontrolador PIC16F84, elaborada pelo prof. Getúlio Teruo Tateoki, Engenheiro e Professor das Engenharias do UniSalesiano-Araçatuba/SP.



Apostila sobre Microcontrolador PIC (PIC16F84)

Apostila elaborada pelo prof. Fábio Renato Elias Boaventura, aborda os conceitos básicos sobre microcontroladores, com foco no PIC16F84, explorando a programação assembly com o MPLab.



quarta-feira, 19 de março de 2014

Apostila Aplicações práticas com o SANUSB e programação C com o Compilador MPLabX

Esta apostila aborda aplicações práticas com microcontroladores PICMicro da família PIC18 da Microchip, Utilizando a plataforma de desenvolvimento SANUSB. Nesta apostila é abordado o uso do compilador C MPLabX C18.
Esta apostila foi elaborada pelos  Profs. Sandro César Silveira Jucá, professor da área de telemática do IFCE, e Renata Imaculada Soares Pereira.







Sumário

Apostila Aplicações práticas com o SANUSB e programação C com o Compilador CCS


Esta apostila aborda aplicações práticas com microcontroladores PICMicro da família PIC18 da Microchip, Utilizando a plataforma de desenvolvimento SANUSB. Esta apostila foi elaborada pelos  Profs. Sandro César Silveira Jucá, professor da área de telemática do IFCE, e Renata Imaculada Soares Pereira.





Sumário

sábado, 1 de fevereiro de 2014

PIC Microcontrollers - Programming in C

domingo, 20 de outubro de 2013

Apostila Mini Curso Microcontrolador 18F452 com Proteus

Apostila Mini Curso Microcontrolador 18F452 utilizando o ECAD Proteus.


segunda-feira, 23 de setembro de 2013

Apostila MICROCONTROLADORES PIC PROGRAMAÇÃO EM LINGUAGEM C: PIC16F628A,16F876A, Compilador CCS C

Apostila sobre Microcontrolador PIC, abordando linguagem C com o compilador CCS C, focando nos modelos PIC16F628A,16F876A.


terça-feira, 6 de agosto de 2013

Apostila de Sistemas Embutidos com Microcontroladores PIC (SENAI/RS)

Deixo aqui, os links do material da disciplina de programação de microcontroladores PIC, abordando assembly e  linguagem C embarcada, com uso do compilador CCS.

Parte 1 =>  INTRODUÇÃO A PROGRAMAÇÃO DE MICROCONTROLADORES : Uma breve introdução a programação de microcontroladores, conhecendo os principais aspectos da programação em baixo nível.

Parte 2 => LINGUAGEM C : Uso de uma linguagem de mais alto nível para desenvolvimento de aplicações dedicadas, visando o reaproveitamento de código e a facilidade em utilizar os recursos do microcontrolador.
Parte 3 =>LINGUAGEM C : Prática e recursos avançados

Material de apoio
Programas exemplos em linguagem C

sexta-feira, 26 de julho de 2013

Microcontroladores PIC - Abordando a IDE MPLABX e o Compilador XC8


Vídeos Tutoriais sobre programação em C para microcontroladores PIC, Abordando a IDE MPLABX e o Compilador XC8. Estes vídeos foram produzidos por Ezequiel Donhauser

Clique nos links para assistir:
<Uma Geral - parte 1>  <Uma Geral - parte 2>  <Delays> <Arquivos de Código e Simulação AQUI>  <Display 16x2> <Arquivos de Código e Simulação AQUI>


sábado, 20 de julho de 2013

Driver do Display Gráfico Everbouquet MG1903A (192x32 com ST7920) para CCS C / PIC

Driver para o Display Everbouquet MG1903A (192x32 com ST7920)

#byte PORTA = 0xF80 
#bit RA0   = PORTA.0 
#bit RA1   = PORTA.1 
#bit RA2   = PORTA.2 
#bit RA3   = PORTA.3 
#bit RA4   = PORTA.4 
#bit RA5   = PORTA.5 
#bit RA6   = PORTA.6 
#bit RA7   = PORTA.7 

#byte PORTB = 0xF81 
#bit RB0   = PORTB.0 
#bit RB1   = PORTB.1 
#bit RB2   = PORTB.2 
#bit RB3   = PORTB.3 
#bit RB4   = PORTB.4 
#bit RB5   = PORTB.5 
#bit RB6   = PORTB.6 
#bit RB7   = PORTB.7 

#byte PORTC = 0xF82 
#bit RC0   = PORTC.0 
#bit RC1   = PORTC.1 
#bit RC2   = PORTC.2 
#bit RC3   = PORTC.3 
#bit RC4   = PORTC.4 
#bit RC5   = PORTC.5 
#bit RC6   = PORTC.6 
#bit RC7   = PORTC.7 

#byte PORTE = 0xF84 
#bit RE3   = PORTE.3 


///////////////////////////////////////////////////////////////////////// 
////                           mg1903a.h                             //// 
////                                                                 //// 
//// This file contains drivers for using a Everbouquet MG1903A with //// 
//// a ST7920 display controller. The MG1903A is 192 by 32 pixels.   //// 
//// The driver treats the upper left pixel as (0,0).                //// 
////                                                                 //// 
///////////////////////////////////////////////////////////////////////// 
////                                                                 //// 
//// LCD Pin connections:                                            //// 
////  * 1: VSS is connected to GND                                   //// 
////  * 2: VDD is connected to +5V                                   //// 
////  * 3: V0  - LCD operating voltage (Constrast adjustment)        //// 
////  * 4: R/S - Data or Instruction is connected to C7              //// 
////  * 5: R/W - Read or Write is connected to C6                    //// 
////  * 6: Enable is connected to C5                                 //// 
////  * 7-14: Data Bus 0 to 7 is connected to port B                  //// 
////  * 15: Positive voltage for LED backlight is connected to +5V    //// 
////  * 16: Negavtive voltage for LED backlight is connected to GND   //// 
////                                                                 //// 
///////////////////////////////////////////////////////////////////////// 
////                                                                 //// 
////  glcd_init ()                                                   //// 
////     * Must be called before any other function.                 //// 
////                                                                 //// 
////  glcd_pixel (x,y,color)                                         //// 
////     * Sets the pixel to the given color.                        //// 
////       - color can be ON or OFF                                  //// 
////                                                                 //// 
////  glcd_fillScreen (color)                                        //// 
////     * Fills the entire LCD with the given color.                //// 
////       - color can be ON or OFF                                  //// 
////                                                                 //// 
///////////////////////////////////////////////////////////////////////// 

#define GLCD_RS      RC7   // Display Data / Control Data. 
#define GLCD_RW      RC6   // Read / Write 
#define GLCD_E      RC5   // Enable Signal. 

#define GLCD_WIDTH   192 

#define RS_FUNCTION   0 
#define RS_DATA      1 
#define RW_WRITE   0 
#define RW_READ      1 
#define TRIS_READ   0xFF 
#define TRIS_WRITE   0x00 

// Valores de color: 
#define ON   1 
#define OFF   0 

typedef union 

  int16 word; 
  BYTE byte[2]; 
} Dots; 

typedef struct 

  BOOLEAN refrescar; 
  Dots dots[32][12];   // Diemensiones máximas del display (x,y) = (191,31). 
} GDRAM;      // El punto (0,0) corresponde a la esquina superior izquierda. 

GDRAM gdram; 


/*----------------------------------------------------------------------------------------- 
 * Nombre:   glcd_readByte 
 * 
 * Propósito:   Reads a byte of data from the LCD. 
 * 
 * In/Out:       
 * 
 * Return:   A byte of data read from the LCD. 
 * 
 * Requisitos:    
 * 
 * Descripción:    
 *----------------------------------------------------------------------------------------*/ 

BYTE glcd_readByte (BYTE address) 

  BYTE data;   // Stores the data read from the LCD 

  set_tris_b (TRIS_READ);   // Set PORTB to input 
  GLCD_RS = address; 
  delay_cycles(1); 
  GLCD_RW = RW_READ;      // Set for reading 
  delay_cycles (1); 
  GLCD_E = 1;      // Pulse the enable pin 
  delay_cycles (1); 
  data = PORTB;      // Get the data from the display's output register 
  GLCD_E = 0; 
  return data; 



/*------------------------------------------------------------------------------------------ 
 * Nombre:   glcd_writeByte 
 * 
 * Propósito:   Write a byte of data to the LCD. 
 * 
 * In/Out:       
 * 
 * Return: 
 *   - data   (in): the byte of data to write. 
 * 
 * Requisitos:    
 * 
 * Descripción:    
 * 
 *----------------------------------------------------------------------------------------*/ 

void glcd_writeByte (BYTE address, BYTE data) 

  GLCD_RS = RS_FUNCTION; 
  while ( bit_test (glcd_readByte(RS_FUNCTION), 7) ) ;   // Whait Busy Flag = FALSE! 
  set_tris_b (TRIS_WRITE);   // Set PORTB to output 
  GLCD_RS = address; 
  delay_cycles(1); 
  GLCD_RW = RW_WRITE;      // Set for writing 
  delay_cycles(1); 
  GLCD_E = 0; 
  PORTB = data;         // Put the data on the port 
  delay_cycles (1); 
  GLCD_E = 1;         // Pulse the enable pin 
  delay_cycles(5); 
  GLCD_E = 0; 



/*------------------------------------------------------------------------------------------ 
 * Nombre:   glcd_fillScreen 
 * 
 * Propósito:   Fill the LCD screen with the passed in color. 
 * 
 * In/Out: 
 *   - color   (in): 
 *          ON  - turn all the pixels on. 
 *         OFF - turn all the pixels off. 
 * 
 * Return:       
 * 
 * Requisitos:    
 * 
 * Descripción:   Sólo trabaja sobre la caché del display. 
 * 
 *----------------------------------------------------------------------------------------*/ 

void glcd_fillScreen (BYTE color) 

  int8 v, h; 
  int16 d; 

  d = (color == ON ? 0xFFFFL : 0x0000L); 

  for (v=0; v<32; v++) 
  { 
    for (h=0; h<12; h++) 
    { 
      gdram.dots[v][h].word = d; 
    } 
  } 
  gdram.refrescar = TRUE; 



/*------------------------------------------------------------------------------------------ 
 * Nombre:   glcd_update 
 * 
 * Propósito:   Update the LCD with data from the display cache. 
 * 
 * In/Out: 
 * 
 * Return:       
 * 
 * Requisitos:    
 * 
 * Descripción:    
 *----------------------------------------------------------------------------------------*/ 

void glcd_update () 

  int8 v, h; 

  if (gdram.refrescar) 
  { 
    for (v=0; v<32; v++) 
    { 
      glcd_writeByte (RS_FUNCTION, 0x80 | v);   // Set Vertical Address. 
      glcd_writeByte (RS_FUNCTION, 0x80 | 0);   // Set Horizontal Address. 

      for (h=0; h<12; h++) 
      { 
        glcd_writeByte (RS_DATA, gdram.dots[v][h].byte[1]);   // Write High Byte. 
        glcd_writeByte (RS_DATA, gdram.dots[v][h].byte[0]);   // Write Low Byte. 
      } 
    } 
    gdram.refrescar = FALSE; 
  } 



/*------------------------------------------------------------------------------------------ 
 * Nombre:   glcd_init 
 * 
 * Propósito:   Inicialza el LCD. 
 * 
 * In/Out: 
 *   - mode   (in): OFF/ON - Turns the LCD off/on. 
 * 
 * Return:       
 * 
 * Requisitos:   Call before using any other LCD function. 
 * 
 * Descripción:    
 *----------------------------------------------------------------------------------------*/ 

void glcd_init () 

  set_tris_b (TRIS_WRITE);   // PORTB as output. 
  GLCD_RS = RS_FUNCTION; 
  GLCD_RW = RW_WRITE; 
  GLCD_E = 0; 
  delay_ms (40); 

  glcd_writeByte (RS_FUNCTION, 0x30);    // Specify 8 bit interface and basic instruction set. 
  delay_us (100); 
  glcd_writeByte (RS_FUNCTION, 0x30);    // Specify 8 bit interface and basic instruction set. 
  delay_us (37); 
  glcd_writeByte (RS_FUNCTION, 0x0C);    // Specify Display on, Cursor off and Blink off. 
  delay_us (100); 
  glcd_writeByte (RS_FUNCTION, 0x01);    // Display clear. 
  delay_ms (10); 
  glcd_writeByte (RS_FUNCTION, 0x06);    // AC Increase (cursor move right), don't shift the display. 
  delay_us (72); 
  glcd_writeByte (RS_FUNCTION, 0x34);    // Select extended instruction set. 
  delay_us (72); 
  glcd_writeByte (RS_FUNCTION, 0x36);    // Graphic display ON. 

  glcd_fillScreen (OFF); 
  glcd_update (); 



/*------------------------------------------------------------------------------------------ 
 * Nombre:    
 * 
 * Propósito:   Turn a pixel on a graphic LCD on or off. 
 * 
 * In/Out: 
 *   - x   (in): the x coordinate of the pixel. 
 *   - y   (in): y - the y coordinate of the pixel. 
 *   - color   (in): ON or OFF. 
 * 
 * Return:       
 * 
 * Requisitos:    
 * 
 * Descripción:    
 *----------------------------------------------------------------------------------------*/ 

void glcd_pixel(int8 x, int8 y, int1 color) 

  int8 v, h, b; 

  v = y; 
  h = x/16; 
  b = 15 - (x%16); 

  // Modify the actual word. 
  if (color == ON) bit_set (gdram.dots[v][h].word, b); 
  else bit_clear (gdram.dots[v][h].word, b); 
  
  gdram.refrescar = TRUE; 
}


main example

#include "mg1903a.h" 
#include "graphics.h" 

#include <math.h> 


#pragma zero_ram 
void main() 

  int1  warn = FALSE; 
  int16  adc = 0L, adc_old = 0L; 
  char  voltText[] = "Volts", warning[] = "Warning", W[] = "W"; 
  float theta = 0; 

  inicializarMicro ();   // Inicializa los registros de configuración del MCU y perifericos. 
  inicializarSD ();   // Inicializa las estructuras de datos utilizadas por el programa. 
  activarSalidas ();   // Inicializar las salidas. 

  glcd_rect(1, 5, 126, 15, NO, ON);   // Outline the bar 
  glcd_text57(30, 18, voltText, 1, ON);   // Display "Volts" 
  glcd_circle(145, 16, 10, NO, ON);   // Draw the clock circle 

  while (TRUE) 
  { 
    adc = entradaAnalogica.valor;   // Read a value from the ADC 
    displayVoltage (adc);      // Display the reading 
    adc = (adc > 249L) ? 249L : adc;   // Keep the value 249 or less 

    if(adc != adc_old) 
    { 
      glcd_rect (adc/2+1, 6, adc_old/2+1, 14, YES, OFF);   // Clears the old bar 
      glcd_rect (1, 6, adc/2+1, 14, YES, ON);         // Draws a new bar 
      adc_old = adc;                  // Set old value to new 

      if (adc > 200 && !warn)   // Check if over 4 volts. 
      { 
        glcd_rect (68, 20, 110, 28, YES, ON);   // Draw a filled black rectangle 
        glcd_text57 (70, 21, warning, 1, OFF);   // Write "Warning" on the LCD 
        glcd_text57 (165, 10, W, 2, ON);   // Escribir una W con el doble de tamaño. 
        warn = TRUE; 
      } 
      else if (adc <= 200 && warn) 
      { 
        glcd_rect (68, 20, 110, 28, YES, OFF);   // Draw a filled white rectangle 
        glcd_rect (165, 10, 180, 28, YES, OFF);   // Draw a filled white rectangle 
        warn = FALSE; 
      } 
    } 

    // The following 3 lines make the clock hand spin around 
    glcd_line (145, 16, 145+(int)(8*sin(theta)+.5), 16-(int)(8*cos(theta)+.5), OFF); 
    theta = (theta > 5.9) ? 0 : (theta += .3); 
    glcd_line (145, 16, 145+(int)(8*sin(theta)+.5), 16-(int)(8*cos(theta)+.5), ON); 

    glcd_update (); 
//    delay_ms(100);    // Reduces flicker by allowing pixels to be on much longer than off. 
  } 
}


Fonte: http://www.ccsinfo.com/forum/viewtopic.php?t=32819&highlight=st7920

LinkWithin

Related Posts Plugin for WordPress, Blogger...