Digital freq counter problem

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
dawladin
Posts: 13
Joined: Mon Feb 04, 2013 12:05 pm
Has thanked: 4 times
Been thanked: 1 time
Contact:

Digital freq counter problem

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Digital freq counter problem

Post 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.

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Digital freq counter problem

Post 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.
Enamul
University of Nottingham
enamul4mm@gmail.com

Post Reply