[quote:652023e230]PostPosted: Sun Jul 23, 2017 8:31 pm Post subject: Simple frequency meter on Atmega8 Simple frequency meter on Atmega8 It's my first code.[/quote:652023e230] And where is the measured frequency in your code?
The principle: (signal on PD5) [code:1:652023e230]pseudocode Dim frequency as word Config timer1 as counter.
Do clear timer1 waitms 1000 'timer counts pulses for 1 second frequency = timer1 'number of pulses after 1 sec = frequency [Hz] display frequency Loop [/code:1:652023e230] This way you can measure frequency 1 - 65535 Hz with resolution 1 Hz. Instead of "waitms 1000" you can use another timer to to make an exact delay 1 second.
[quote:73880b3574="KenHorse"]While I appreciate the previous responses, they really didn't address why the problem is happening ONLY for singles and doubles and not other ERAM types.[/quote:73880b3574]Hm, you're correct. Seems the strong rules which the help dictates, are broken/softened by the compiler, while this "softening" left out floats.
'this program is tested on PROTEUS 'Inject pulse between range 500 to 31k hertz to PD4 $regfile = "m8def.dat" $crystal = 8000000 $baud = 9600 Config Portb.5 = Output Config Timer2 = Timer , Prescale = 256 On Timer2 Timer2isr : Enable Interrupts : Enable Timer2 Dim F As Word , R As Byte Config Timer0 = Counter , Edge = Rising : Start Timer0
Do If R > 0 Then F = F : F = F * 121 : Print F : R = 0 : End If Loop
Timer2isr: If R = 0 Then : F = Timer0 : R = 1 : Timer0 = 0 : End If Return
Hi Neil, for a project of mine, i was using an external serial flash "ESF" with 512KB. (AT45DB041B) There is one emergency System Backup flashed, wich can be reflased into Mega by pressing button on reset i.e.
Sending new system will be flashed first into ESF. After whole transmission into ESF, Data is checked (CRC...) and if it was ok, it is flased into Mega.
We even sent one of these boxes to a customer (high security zone where the service guys have no access and the customer didn't want to remove the devices from the area) and they where surprised how easy/quick it was.
hi Ian, thats exactly the info i needed. Thanks. i have about 40 devices out in the feild, and they each have a hex bootloder that works ok but is slow., If i need to update formware, i FTP a new hex file plus a 16bit crc. But id like to update them with a bootloader that will accept a bin file, which is/only 13 as long. My hex file is 74k and takes a while over the cellular network. The best solution would be to update the bootloader OTA, but your little gadget is a possibilty i think.