Ir ao conteúdo
  • Cadastre-se

Bruno R Ruinho

Membro Pleno
  • Posts

    119
  • Cadastrado em

  • Última visita

Tudo que Bruno R Ruinho postou

  1. @MatheusLPS esse programa e o seu mesmo!! , mas pelo que vi o 16F628A nao suporta, so tem 1 - CCP e poucas portas. Vou utilizar no carro, em um LCD de 8x2 o dia da semana nao vai aparecer, e a temperatura estava pensando assim: 1 - quando der nivel logico alto em um pino sobrando (12V da chave) o backlight acende, so tirar o CCP de temp do backlight.. penso eu.. 2 - quando der nivel logico alto em outro pino sobrando(12v do ventilador do ar) ele mostra a temp no lugar da data e fica alternado a cada 2s - a hora fica fixo. Circuit e Rafael Del Pino e exatamente isso, testei aqui e funcionou! Obriagdo!
  2. Seria o segundo na lista correto? Funciona com Win7 normal? precisa instalar algum drive especifico? Obrigado!
  3. Estou querendo mudar para o PIC 16F628A Vou postar o programa: No programa não aparece o port D.
  4. Bom Dia! Não estou conseguindo visualizar a porta que esta sendo usada nessa biblioteca: /////////////////////////////////////////////////////////////////////////// //// LCDD.C //// //// Driver for common LCD modules //// //// //// //// lcd_init() Must be called before any other function. //// //// //// //// lcd_putc© Will display c on the next position of the LCD. //// //// The following have special meaning: //// //// \f Clear display //// //// \n Go to start of second line //// //// \b Move back one position //// //// //// //// lcd_gotoxy(x,y) Set write position on LCD (upper left is 1,1) //// //// //// //// lcd_getc(x,y) Returns character at position x,y on LCD //// //// //// /////////////////////////////////////////////////////////////////////////// //// © Copyright 1996,2007 Custom Computer Services //// //// This source code may only be used by licensed users of the CCS C //// //// compiler. This source code may only be distributed to other //// //// licensed users of the CCS C compiler. No other use, reproduction //// //// or distribution is permitted without written permission. //// //// Derivative programs created using this software in object code //// //// form are not restricted in any way. //// /////////////////////////////////////////////////////////////////////////// // As defined in the following structure the pin connection is as follows: // D0 enable // D1 rs // D2 rw // D4 D4 // D5 D5 // D6 D6 // D7 D7 // // LCD pins D0-D3 are not used and PIC D3 is not used. // Un-comment the following define to use port B // #define use_portb_lcd TRUE struct lcd_pin_map { // This structure is overlayed BOOLEAN enable; // on to an I/O port to gain BOOLEAN rs; // access to the LCD pins. BOOLEAN rw; // The bits are allocated from BOOLEAN unused; // low order up. ENABLE will int data : 4; // be pin B0. } lcd; #if defined use_portb_lcd // #locate lcd = getenv("sfr:PORTB") // This puts the entire structure over the port #ifdef __pch__ #locate lcd = 0xf81 #else #locate lcd = 6 #endif #define set_tris_lcd(x) set_tris_b(x) #else //#locate lcd = getenv("sfr:PORTD") // This puts the entire structure over the port #ifdef __pch__ #locate lcd = 0xf83 #else #locate lcd = 8 #endif #define set_tris_lcd(x) set_tris_d(x) #endif #ifndef lcd_type #define lcd_type 2 // 0=5x7, 1=5x10, 2=2 lines #endif #define lcd_line_two 0x40 // LCD RAM address for the second line BYTE const LCD_INIT_STRING[4] = {0x20 | (lcd_type << 2), 0xc, 1, 6}; // These bytes need to be sent to the LCD // to start it up. // The following are used for setting // the I/O port direction register. struct lcd_pin_map const LCD_WRITE = {0,0,0,0,0}; // For write mode all pins are out struct lcd_pin_map const LCD_READ = {0,0,0,0,15}; // For read mode data pins are in BYTE lcd_read_byte() { BYTE low,high; set_tris_lcd(LCD_READ); lcd.rw = 1; delay_cycles(1); lcd.enable = 1; delay_cycles(1); high = lcd.data; lcd.enable = 0; delay_cycles(1); lcd.enable = 1; delay_us(1); low = lcd.data; lcd.enable = 0; set_tris_lcd(LCD_WRITE); return( (high<<4) | low); } void lcd_send_nibble( BYTE n ) { lcd.data = n; delay_cycles(1); lcd.enable = 1; delay_us(2); lcd.enable = 0; } void lcd_send_byte( BYTE address, BYTE n ) { lcd.rs = 0; while ( bit_test(lcd_read_byte(),7) ) ; lcd.rs = address; delay_cycles(1); lcd.rw = 0; delay_cycles(1); lcd.enable = 0; lcd_send_nibble(n >> 4); lcd_send_nibble(n & 0xf); } void lcd_init() { BYTE i; set_tris_lcd(LCD_WRITE); lcd.rs = 0; lcd.rw = 0; lcd.enable = 0; delay_ms(15); for(i=1;i<=3;++i) { lcd_send_nibble(3); delay_ms(5); } lcd_send_nibble(2); for(i=0;i<=3;++i) lcd_send_byte(0,LCD_INIT_STRING); } void lcd_gotoxy( BYTE x, BYTE y) { BYTE address; if(y!=1) address=lcd_line_two; else address=0; address+=x-1; lcd_send_byte(0,0x80|address); } void lcd_putc( char c) { switch © { case '\f' : lcd_send_byte(0,1); delay_ms(2); break; case '\n' : lcd_gotoxy(1,2); break; case '\b' : lcd_send_byte(0,0x10); break; default : lcd_send_byte(1,c); break; } } char lcd_getc( BYTE x, BYTE y) { char value; lcd_gotoxy(x,y); while ( bit_test(lcd_read_byte(),7) ); // wait until busy flag is low lcd.rs=1; value = lcd_read_byte(); lcd.rs=0; return(value); }
  5. E mais ou menos assim: #device adc=10 //Habilitar ADC de 10 bits. int16 adc; float temperatura; void main() setup_adc_ports(AN0); //Configura canal 0 analógico setup_adc(ADC_CLOCK_INTERNAL); //De acordo com relógio interno. set_adc_channel(0); //Habilita canal 0 delay_us(20); //Espera um pouco (obrigatório!) default: { adc = read_adc(); //Lê canal 0 temperatura = (5.0 * adc * 100) / 1024.0; //Conversão para tensão. printf(lcd_putc,,............
  6. Boa Noite a todos! Estou em duvida qual gravador comprar, existem tantos no mercado, uns bons e outros nem tanto. Segue os que eu estou vendo: http://produto.mercadolivre.com.br/MLB-636573389-programador-gravador-pickit2-gravador-de-pic-usb-_JM http://produto.mercadolivre.com.br/MLB-636816375-gravador-picburner-k150-usb-pic-de-brindesoftwares-cabos-_JM http://produto.mercadolivre.com.br/MLB-650676808-gravador-programador-usb-pic-pickit2-mplab-zif-frete-brasil-_JM A variacao de valores entre os 3 e enorme... tenho PIC das familias 16F e 18F acho que o o primeiro atende bem mas quero a opiniao de todos! Meu sistema e Win7 (o texto esta sem pontuacao pois o teclado que estou usando nao esta configurado)
  7. Bom Dia a todos! Segue o projeto de um relogio digital com RTC sendo: LCD 8x2 PIC 16F877A 2 botões - UM "SET" E O OUTRO DE INCREMENTO DE VALORES (+) DS1307 - RTC Iniciei o programa mas nao sei mais o que fazer >>> não sei como inserir o RTC nem para mostrar os dados no LCD. //--------------------------------------------------------------------------------------------------------- // Autor: Ruinho // Data: 06/Novembro/2014 // Compilador: mikroC - PIC - 5.6.1 /*=========================================================================================================*/ // *** Definições do Microcontrolador *** // Conexoes do LCD sbit LCD_RS at RD2_bit; sbit LCD_EN at RD3_bit; sbit LCD_D4 at RD4_bit; sbit LCD_D5 at RD5_bit; sbit LCD_D6 at RD6_bit; sbit LCD_D7 at RD7_bit; sbit LCD_RS_Direction at TRISD2_bit; sbit LCD_EN_Direction at TRISD3_bit; sbit LCD_D4_Direction at TRISD4_bit; sbit LCD_D5_Direction at TRISD5_bit; sbit LCD_D6_Direction at TRISD6_bit; sbit LCD_D7_Direction at TRISD7_bit; // Fim das conecxoes do LCD char txt1[] = "07/11/14"; char txt2[] = "17:55:42"; char i; // Loop void main(){ Lcd_Init(); // Inicializa o LCD Lcd_Cmd(_LCD_CLEAR); // Apaga display Lcd_Cmd(_LCD_CURSOR_OFF); // Desliga Cursor Lcd_Out(1,1,txt1); // Escreve na primeira linha e primeira coluna Lcd_Out(2,1,txt2); // Escreve na segunda linha e primeira coluna } No anexo esta como seria a parte do "SET" das horas e da data. PEÇO A AJUDA DE TODOS! Miniaturas anexadas: Consegui alguma coisa com a ajuda de uns amigos... mas quando vou montar no proteus o LCD fica travado em 0 !! Não sei o que pode ser, alguem poderia me ajudar?? sbit LCD_RS at RB4_bit; sbit LCD_EN at RB5_bit; sbit LCD_D4 at RB6_bit; sbit LCD_D5 at RB1_bit; sbit LCD_D6 at RB2_bit; sbit LCD_D7 at RB3_bit; sbit LCD_RS_Direction at TRISB4_bit; sbit LCD_EN_Direction at TRISB5_bit; sbit LCD_D4_Direction at TRISB6_bit; sbit LCD_D5_Direction at TRISB1_bit; sbit LCD_D6_Direction at TRISB2_bit; sbit LCD_D7_Direction at TRISB3_bit; unsigned short segundos, minutos, horas, semana, dia, mes, ano; unsigned short sgs, mins, hrs, ss, dd, mm, yy; unsigned short cnt=7; //Função para converter BCD para string e escrever no LCD void BcdToStr(unsigned short x, unsigned short y, unsigned short var) { unsigned short var1, var2; var1 = (var << 4) + 0x30; Lcd_Chr(x,y,var1); var2 = (var & 0x0F) + 0x30; Lcd_Chr_CP(var2); } //função para ajustar o valor void escrita_i2c(unsigned short registro, unsigned short valor) { i2c1_stop(); //caso o barramento estiver ocupado envia um sinal de STOP i2c1_start(); // envia um sinal de START i2c1_wr(0xD0); //endereço do RTC no barramento e fazer a escrita i2c1_wr(registro); //endereço do registro(segundos=0x00, ...) i2c1_wr(valor); // valor que você quer escrever i2c1_stop(); //envia um sinal de STOP } //função que daz a leitura dos dados void leitura_i2c() { i2c1_start(); // Envia um sinal de START i2c1_wr(0xD0); //endereço no barramento e indicação de escrita i2c1_wr(0x00); //endereço inicial i2c1_Repeated_Start(); //Restart no barramento i2c1_wr(0xD1); // endereço no barramento e indicação de leitura segundos = i2c1_rd(1); //lê o 1º endereço e informa que ira continuar a leitura minutos = i2c1_rd(1); //lê o 2º endereço e informa que ira continuar a leitura horas = i2c1_rd(1); //lê o 3º endereço e informa que ira continuar a leitura semana = i2c1_rd(1); //lê o 4º endereço e informa que ira continuar a leitura dia = i2c1_rd(1); //lê o 5º endereço e informa que ira continuar a leitura mes = i2c1_rd(1); //lê o 6º endereço e informa que ira continuar a leitura ano = i2c1_rd(0); //lê o 7º endereço e informa que não ira mais ler i2c1_stop(); // envia um sinal de STOP } void encontrar_semana() { switch(semana) { case 1: Lcd_Out(2,13,"DOMINGO");break; case 2: Lcd_Out(2,13,"SEGUNDA");break; case 3: Lcd_Out(2,13," TERCA ");break; case 4: Lcd_Out(2,13,"QUARTA ");break; case 5: Lcd_Out(2,13,"QUINTA ");break; case 6: Lcd_Out(2,13," SEXTA ");break; case 7: Lcd_Out(2,13,"sábado ");break; } } //função que escreve no LCD qual ajuste você está fazendo void funcao(unsigned short num) { lcd_Out(1,13,"ADJ"); switch(num) { case 0: Lcd_Out(1,17,"SGS");break; case 1: Lcd_Out(1,17,"MIN");break; case 2: Lcd_Out(1,17,"HRS");break; case 3: Lcd_Out(1,17,"DIA");break; case 4: Lcd_Out(1,17,"DATE");break; case 5: Lcd_Out(1,17,"MES ");break; case 6: Lcd_Out(1,17,"ANO");break; case 7: Lcd_Out(1,17,"OFF");break; } } void main() { bit oldstate; TRISD = 255; I2C1_Init( 100000 ); Lcd_Init(); //inicia LCD Lcd_Cmd(_LCD_CLEAR); //Limpa LCD Lcd_cmd(_LCD_CURSOR_OFF); //desliga cursor do LCD funcao(7); while(1) { BcdToStr(1,1,horas); Lcd_Out_CP(":"); BcdToStr(1,4,minutos); Lcd_Out_CP(":"); BcdToStr(1,7,segundos); BCdToStr(2,1,dia); Lcd_Out_CP("/"); BCdToStr(2,4,mes); Lcd_Out_CP("/"); BCdToStr(2,7,ano); leitura_i2c(); if(!PORTD.F0) oldstate=1; //para cada vez que pressionar o botao, altera a função de ajuste if(PORTD.F0 && oldstate) { cnt++; if(cnt==8) cnt=0; funcao(cnt); oldstate=0; } if(cnt==0) { if(PORTD.F1 && !PORTD.F2) { sgs = Bcd2Dec(segundos); //recebe o valor, converte-o sgs++; // incrementa-o if(sgs==60) sgs=0; escrita_i2c(0x00,Dec2Bcd(sgs)); //converte-o e escreve no RTC }else if(!PORTD.F1 && PORTD.F2) { sgs = Bcd2Dec(segundos); sgs--; if(sgs > 0 || sgs < 59) sgs=59; escrita_i2c(0x00,Dec2Bcd(sgs)); } } else if(cnt==1) { if(PORTD.F1 && !PORTD.F2) { mins = Bcd2Dec(minutos); mins++; if(mins==60) mins=0; escrita_i2c(0x01,Dec2Bcd(mins)); }else if(!PORTD.F1 && PORTD.F2) { mins = Bcd2Dec(minutos); mins--; if(mins > 0 || mins < 59) mins=59; escrita_i2c(0x01,Dec2Bcd(mins)); } } else if(cnt==2) { if(PORTD.F1 && !PORTD.F2) { hrs = Bcd2Dec(horas); hrs++; if(hrs==24) hrs=0; escrita_i2c(0x02,Dec2Bcd(hrs)); }else if(!PORTD.F1 && PORTD.F2) { hrs = Bcd2Dec(horas); hrs--; if(hrs > 0 || hrs < 23) hrs=23; escrita_i2c(0x02,Dec2Bcd(hrs)); } } else if(cnt==3) { if(PORTD.F1 && !PORTD.F2) { ss = Bcd2Dec(semana); ss++; if(ss==8) ss=1; escrita_i2c(0x03,Dec2Bcd(ss)); } else if(!PORTD.F1 && PORTD.F2) { ss = Bcd2Dec(semana); ss--; if(ss==0) ss=7; escrita_i2c(0x03,Dec2Bcd(ss)); } } else if(cnt==4) { if(PORTD.F1 && !PORTD.F2) { dd = Bcd2Dec(dia); dd++; if(dd==32) dd=1; escrita_i2c(0x04,Dec2Bcd(dd)); } else if(!PORTD.F1 && PORTD.F2) { dd = Bcd2Dec(dia); dd--; if(dd > 1 || dd < 31) dd=31; escrita_i2c(0x04,Dec2Bcd(dd)); } } else if(cnt==5) { if(PORTD.F1 && !PORTD.F2) { mm = Bcd2Dec(mes); mm++; if(mm==13) mm=1; escrita_i2c(0x05,Dec2Bcd(mm)); } else if(!PORTD.F1 && PORTD.F2) { mm = Bcd2Dec(mes); mm--; if(mm==0) mm=12; escrita_i2c(0x05,Dec2Bcd(mm)); } } else if(cnt==6) { if(PORTD.F1 && !PORTD.F2) { yy = Bcd2Dec(ano); yy++; if(yy==100) yy=0; escrita_i2c(0x06,Dec2Bcd(yy)); } else if(!PORTD.F1 && PORTD.F2) { yy = Bcd2Dec(ano); yy--; if(yy > 0 || yy < 99) yy=99; escrita_i2c(0x06,Dec2Bcd(yy)); } } encontrar_semana(); Delay_ms(200); } } Mas ainda não funciona, Alguem poderia me ajudar?
  8. Use um TIP31 e um zener de 3V8 na base, ele cairá para 4,5 como voce quer, coloque tambem um diodo no coletor do TIP para dar uma queda de tensão antes! Espero ter ajudado!
  9. Coloque um TIP147 e um diodo zener, acabou os problemas ele aguentará normalmente.!
  10. Bom Dia! Esta faltando informações nesse tópico como: Marca, Modelo, Esquemático, Fotos da placa aonde esta mexendo...
  11. Bom Dia a Todos! Consegui alguma coisa com a ajuda de uns amigos... mas quando vou montar no proteus o LCD fica travado em 0 !! Não sei o que pode ser, alguem poderia me ajudar?? sbit LCD_RS at RB4_bit; sbit LCD_EN at RB5_bit; sbit LCD_D4 at RB6_bit; sbit LCD_D5 at RB1_bit; sbit LCD_D6 at RB2_bit; sbit LCD_D7 at RB3_bit; sbit LCD_RS_Direction at TRISB4_bit; sbit LCD_EN_Direction at TRISB5_bit; sbit LCD_D4_Direction at TRISB6_bit; sbit LCD_D5_Direction at TRISB1_bit; sbit LCD_D6_Direction at TRISB2_bit; sbit LCD_D7_Direction at TRISB3_bit; unsigned short segundos, minutos, horas, semana, dia, mes, ano; unsigned short sgs, mins, hrs, ss, dd, mm, yy; unsigned short cnt=7; //Função para converter BCD para string e escrever no LCD void BcdToStr(unsigned short x, unsigned short y, unsigned short var) { unsigned short var1, var2; var1 = (var << 4) + 0x30; Lcd_Chr(x,y,var1); var2 = (var & 0x0F) + 0x30; Lcd_Chr_CP(var2); } //função para ajustar o valor void escrita_i2c(unsigned short registro, unsigned short valor) { i2c1_stop(); //caso o barramento estiver ocupado envia um sinal de STOP i2c1_start(); // envia um sinal de START i2c1_wr(0xD0); //endereço do RTC no barramento e fazer a escrita i2c1_wr(registro); //endereço do registro(segundos=0x00, ...) i2c1_wr(valor); // valor que você quer escrever i2c1_stop(); //envia um sinal de STOP } //função que daz a leitura dos dados void leitura_i2c() { i2c1_start(); // Envia um sinal de START i2c1_wr(0xD0); //endereço no barramento e indicação de escrita i2c1_wr(0x00); //endereço inicial i2c1_Repeated_Start(); //Restart no barramento i2c1_wr(0xD1); // endereço no barramento e indicação de leitura segundos = i2c1_rd(1); //lê o 1º endereço e informa que ira continuar a leitura minutos = i2c1_rd(1); //lê o 2º endereço e informa que ira continuar a leitura horas = i2c1_rd(1); //lê o 3º endereço e informa que ira continuar a leitura semana = i2c1_rd(1); //lê o 4º endereço e informa que ira continuar a leitura dia = i2c1_rd(1); //lê o 5º endereço e informa que ira continuar a leitura mes = i2c1_rd(1); //lê o 6º endereço e informa que ira continuar a leitura ano = i2c1_rd(0); //lê o 7º endereço e informa que não ira mais ler i2c1_stop(); // envia um sinal de STOP } void encontrar_semana() { switch(semana) { case 1: Lcd_Out(2,13,"DOMINGO");break; case 2: Lcd_Out(2,13,"SEGUNDA");break; case 3: Lcd_Out(2,13," TERCA ");break; case 4: Lcd_Out(2,13,"QUARTA ");break; case 5: Lcd_Out(2,13,"QUINTA ");break; case 6: Lcd_Out(2,13," SEXTA ");break; case 7: Lcd_Out(2,13,"sábado ");break; } } //função que escreve no LCD qual ajuste você está fazendo void funcao(unsigned short num) { lcd_Out(1,13,"ADJ"); switch(num) { case 0: Lcd_Out(1,17,"SGS");break; case 1: Lcd_Out(1,17,"MIN");break; case 2: Lcd_Out(1,17,"HRS");break; case 3: Lcd_Out(1,17,"DIA");break; case 4: Lcd_Out(1,17,"DATE");break; case 5: Lcd_Out(1,17,"MES ");break; case 6: Lcd_Out(1,17,"ANO");break; case 7: Lcd_Out(1,17,"OFF");break; } } void main() { bit oldstate; TRISD = 255; I2C1_Init( 100000 ); Lcd_Init(); //inicia LCD Lcd_Cmd(_LCD_CLEAR); //Limpa LCD Lcd_cmd(_LCD_CURSOR_OFF); //desliga cursor do LCD funcao(7); while(1) { BcdToStr(1,1,horas); Lcd_Out_CP(":"); BcdToStr(1,4,minutos); Lcd_Out_CP(":"); BcdToStr(1,7,segundos); BCdToStr(2,1,dia); Lcd_Out_CP("/"); BCdToStr(2,4,mes); Lcd_Out_CP("/"); BCdToStr(2,7,ano); leitura_i2c(); if(!PORTD.F0) oldstate=1; //para cada vez que pressionar o botao, altera a função de ajuste if(PORTD.F0 && oldstate) { cnt++; if(cnt==8) cnt=0; funcao(cnt); oldstate=0; } if(cnt==0) { if(PORTD.F1 && !PORTD.F2) { sgs = Bcd2Dec(segundos); //recebe o valor, converte-o sgs++; // incrementa-o if(sgs==60) sgs=0; escrita_i2c(0x00,Dec2Bcd(sgs)); //converte-o e escreve no RTC }else if(!PORTD.F1 && PORTD.F2) { sgs = Bcd2Dec(segundos); sgs--; if(sgs > 0 || sgs < 59) sgs=59; escrita_i2c(0x00,Dec2Bcd(sgs)); } } else if(cnt==1) { if(PORTD.F1 && !PORTD.F2) { mins = Bcd2Dec(minutos); mins++; if(mins==60) mins=0; escrita_i2c(0x01,Dec2Bcd(mins)); }else if(!PORTD.F1 && PORTD.F2) { mins = Bcd2Dec(minutos); mins--; if(mins > 0 || mins < 59) mins=59; escrita_i2c(0x01,Dec2Bcd(mins)); } } else if(cnt==2) { if(PORTD.F1 && !PORTD.F2) { hrs = Bcd2Dec(horas); hrs++; if(hrs==24) hrs=0; escrita_i2c(0x02,Dec2Bcd(hrs)); }else if(!PORTD.F1 && PORTD.F2) { hrs = Bcd2Dec(horas); hrs--; if(hrs > 0 || hrs < 23) hrs=23; escrita_i2c(0x02,Dec2Bcd(hrs)); } } else if(cnt==3) { if(PORTD.F1 && !PORTD.F2) { ss = Bcd2Dec(semana); ss++; if(ss==8) ss=1; escrita_i2c(0x03,Dec2Bcd(ss)); } else if(!PORTD.F1 && PORTD.F2) { ss = Bcd2Dec(semana); ss--; if(ss==0) ss=7; escrita_i2c(0x03,Dec2Bcd(ss)); } } else if(cnt==4) { if(PORTD.F1 && !PORTD.F2) { dd = Bcd2Dec(dia); dd++; if(dd==32) dd=1; escrita_i2c(0x04,Dec2Bcd(dd)); } else if(!PORTD.F1 && PORTD.F2) { dd = Bcd2Dec(dia); dd--; if(dd > 1 || dd < 31) dd=31; escrita_i2c(0x04,Dec2Bcd(dd)); } } else if(cnt==5) { if(PORTD.F1 && !PORTD.F2) { mm = Bcd2Dec(mes); mm++; if(mm==13) mm=1; escrita_i2c(0x05,Dec2Bcd(mm)); } else if(!PORTD.F1 && PORTD.F2) { mm = Bcd2Dec(mes); mm--; if(mm==0) mm=12; escrita_i2c(0x05,Dec2Bcd(mm)); } } else if(cnt==6) { if(PORTD.F1 && !PORTD.F2) { yy = Bcd2Dec(ano); yy++; if(yy==100) yy=0; escrita_i2c(0x06,Dec2Bcd(yy)); } else if(!PORTD.F1 && PORTD.F2) { yy = Bcd2Dec(ano); yy--; if(yy > 0 || yy < 99) yy=99; escrita_i2c(0x06,Dec2Bcd(yy)); } } encontrar_semana(); Delay_ms(200); } }
  12. Boa Tarde! Nesse circuito apresentado primeiro como faço para que a corrente de carga seja 5A? Aguardo e Obrigado!
  13. Bom Dia a todos! Segue o projeto de um relogio digital com RTC sendo: LCD 8x2 PIC 16F877A 2 botões - UM "SET" E O OUTRO DE INCREMENTO DE VALORES (+) DS1307 - RTC Iniciei o programa mas nao sei mais o que fazer >>> não sei como inserir o RTC nem para mostrar os dados no LCD. //--------------------------------------------------------------------------------------------------------- // Autor: Ruinho // Data: 06/Novembro/2014 // Compilador: mikroC - PIC - 5.6.1 /*=========================================================================================================*/ // *** Definições do Microcontrolador *** // Conexoes do LCD sbit LCD_RS at RD2_bit; sbit LCD_EN at RD3_bit; sbit LCD_D4 at RD4_bit; sbit LCD_D5 at RD5_bit; sbit LCD_D6 at RD6_bit; sbit LCD_D7 at RD7_bit; sbit LCD_RS_Direction at TRISD2_bit; sbit LCD_EN_Direction at TRISD3_bit; sbit LCD_D4_Direction at TRISD4_bit; sbit LCD_D5_Direction at TRISD5_bit; sbit LCD_D6_Direction at TRISD6_bit; sbit LCD_D7_Direction at TRISD7_bit; // Fim das conecxoes do LCD char txt1[] = "07/11/14"; char txt2[] = "17:55:42"; char i; // Loop void main(){ Lcd_Init(); // Inicializa o LCD Lcd_Cmd(_LCD_CLEAR); // Apaga display Lcd_Cmd(_LCD_CURSOR_OFF); // Desliga Cursor Lcd_Out(1,1,txt1); // Escreve na primeira linha e primeira coluna Lcd_Out(2,1,txt2); // Escreve na segunda linha e primeira coluna } No anexo esta como seria a parte do "SET" das horas e da data. PEÇO A AJUDA DE TODOS!
  14. Certo, então a função desse varistor entre Neutro e Terra sera absorver esse surto ?! e o fusível térmico será somente para ele não incendiar ?! Outra duvida que perguntei e não me respondeu seria as espiras da bobina, quantas são e qual fio utilizar? Obrigado!
  15. Bom Dia a todos! Desculpem estar ressuscitando o post mas fiquei na duvida (ou não tenha lido) quantas são as espiras da bobina toroidal? Outro detalhe que não entendi é o porque do varistor+fusível térmico entre terra e neutro ( caso haja um surto no neutro o varistor vai aquecer e abrir o fusível; mas isso mudaria o que para proteger? ). O placa difícil de desenhar, eu estou olhando ate agora para ver se esta tudo certo!..kkk Obrigado e Aguardo!

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...

Ebook grátis: Aprenda a ler resistores e capacitores!

EBOOK GRÁTIS!

CLIQUE AQUI E BAIXE AGORA MESMO!