Jump to content
ELFORUM - Forumul electronistilor

frecvențmetre cu pic


MifTy

Recommended Posts

salut, am incercat sa fac un frecventmetru cu pic16f628A, dar nu a mers, asa ca m-am apucat eu de un cod pentru asa ceva. am gasit pe un site ceva indicatii dar nu stiu cum sa pot modifica codul pentru ce imi trebuie, m-am blocarea la setarea pinului RA4 ca intrare TOCK si restul portului sa fie iesire.

site http://embedded-lab.com/blog/?p=1042

are cineva vreo idee sa ma ajute sa modific codul?

// LCD module connectionssbit LCD_RS at RC4_bit;sbit LCD_EN at RC5_bit;sbit LCD_D4 at RC0_bit;sbit LCD_D5 at RC1_bit;sbit LCD_D6 at RC2_bit;sbit LCD_D7 at RC3_bit;sbit LCD_RS_Direction at TRISC4_bit;sbit LCD_EN_Direction at TRISC5_bit;sbit LCD_D4_Direction at TRISC0_bit;sbit LCD_D5_Direction at TRISC1_bit;sbit LCD_D6_Direction at TRISC2_bit;sbit LCD_D7_Direction at TRISC3_bit;// End LCD module connections// Define Messageschar message1[] = "Frequency=   Hz";char *freq = "00";void Display_Freq(unsigned int freq2write) { freq[0] = (freq2write/10)%10 + 48;    // Extract tens digit freq[1] =  freq2write%10     + 48;    // Extract ones digit // Display Frequency on LCD Lcd_Out(1, 11, freq);}void main() { CMCON0 = 0x07;    // Disable Comparators ANSEL = 0x00;     // Disable analog channels TRISC = 0x00;     // PORTC O/P TRISA = 0b00001100; // RA2/T0CKI input, RA3 is I/P only OPTION_REG = 0b00101000; // Prescaler (1:1), TOCS =1 for counter mode Lcd_Init();                 // Initialize LCD Lcd_Cmd(_LCD_CLEAR);        // CLEAR display Lcd_Cmd(_LCD_CURSOR_OFF);   // Cursor off Lcd_Out(1,1,message1);      // Write message1 in 1st row do {  TMR0=0;  Delay_ms(1000);  // Delay 1 Sec  Display_Freq(TMR0); } while(1);  // Infinite loop}
Link to comment
  • Replies 20
  • Created
  • Last Reply

Top Posters In This Topic

  • nico_2010

    5

  • marianqt

    3

  • maciupiciu

    3

  • MifTy

    2

  • 2 weeks later...
Guest badeacostin82

Buna ziuaMa poate ajuta cineva cu hexul frecventmetrului de pe site-ul lui IK3OIL(pic 16f84a)? Ma chinui de cateva zile cu diverse hexuri de pe net si apar numai patratele negre.Sper ca am postat unde trebuie. Sunt nou pe site.Va multumesc.

Link to comment
Guest badeacostin82

Va multumesc mult pentru ajutorul prompt.Ma bucur sa aflu ca mai exista oameni care ajuta neconditionat.Cu deosebit respect,Silviu Badea

Link to comment
  • 9 months later...

Am reusit sa termin carcasa frecventmetrului. Am improvizat din ce-am avut o cutiuta, in care m-am cam chinuit sa inghesui montajul.

Pentru semnale puternice folosesc un capat de 50 Ohmi, iar pentru semnale mai slabe, o mica antena sau chiar o sonda din cablu coaxial.

A iesit asa:

 

Posted Image

 

Posted Image

 

Posted Image

 

Posted Image

 

Atasez arhiva cu schema, hex-ul si cablajul.

Freq_count.zip

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.Terms of Use si Guidelines