Vlad Mihai Posted January 27, 2013 Share Posted January 27, 2013 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
nico_2010 Posted January 27, 2013 Share Posted January 27, 2013 Inlocuieste asta:"TRISA = 0b00001100" cu :"TRISA = 0b00010000" Link to comment
Guest badeacostin82 Posted February 7, 2013 Share Posted February 7, 2013 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
nico_2010 Posted February 7, 2013 Share Posted February 7, 2013 Il gasesti in atasament Link to comment
Guest badeacostin82 Posted February 8, 2013 Share Posted February 8, 2013 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
mcross Posted November 17, 2013 Share Posted November 17, 2013 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: Atasez arhiva cu schema, hex-ul si cablajul. Freq_count.zip Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now