Page 1 of 1

Digital freq counter problem

Posted: Thu Mar 21, 2013 2:26 pm
by dawladin
Hello fellow flowcode users :)

I am trying to messure the freq created by my flowmeter and i was wondering if there was a smart way to do this.

I have tried the program digitmal freq counter and i can't get it working.
when i try to compile it it returns with a message that

Code: Select all

tmr0 =0x00;
is invalid.

[quote]
C:\Users\Mich606q\Downloads>"C:\PROGRA~1\MATRIX~1\FLOWCO~1\Tools\MX_bats\..\bin\avr-gcc.exe" -mmcu=atmega16 -Os -funsigned-char -o "C:\Users\Mich606q\DOWNLO~1\5. Digital frequency counter.elf" "C:\Users\Mich606q\DOWNLO~1\5. Digital frequency counter.c" -lm
C:\Users\Mich606q\DOWNLO~1\5. Digital frequency counter.c: In function 'main':
C:\Users\Mich606q\DOWNLO~1\5. Digital frequency counter.c:606: error: 'tmr0' undeclared (first use in this function)
C:\Users\Mich606q\DOWNLO~1\5. Digital frequency counter.c:606: error: (Each undeclared identifier is reported only once
C:\Users\Mich606q\DOWNLO~1\5. Digital frequency counter.c:606: error: for each function it appears in.)

Error returned from [avr-gcc.exe]

Return code = 1

Flowcode var ude i stand til at kompilere flowchart's C kode pågrund af følgende fejl:


If dit flowchart indeholder C kode, review det nøje. Hvis dit flowchart ikke indeholder C-kode og du virkelig har reviewed koden, kontakt Teknisk

FINISHED[/quote
]i am useing ATmega16 with 16 Mhz crystal

So i was hopeing that there was one with the solution


Regards Michael

Re: Digital freq counter problem

Posted: Thu Mar 21, 2013 3:21 pm
by Benj
Hello Michael,

Try changing the code in the C icon with the title "Reset Timer Count register" to the following.

Code: Select all

TCNT0 = 0;
Let me know how you get on.

Re: Digital freq counter problem

Posted: Thu Mar 21, 2013 9:21 pm
by Enamul
Hi
I want to add with Ben that you have used tmr0 which is available in PIC ic not in ATMEL ics and for PIC ic register need to use in small letter but for AVR chips register need to mention in caps.