Main Menu
Counter
This page today ...
total: 0
unique: 0

This page ever ...
total: 156
unique: 87

Site ...
total: 2449
unique: 983
Online
  • Guests: 1
  • Members: 0
  • Newest Member: ole
  • Most ever online: 36
    Guests: 36, Members: 0 on Tuesday 11 April 2017 - 04:26:13
Chatbox
You must be logged in to post comments on this site - please either log in from the Login box or from here.If you are not registered click here to signup.


bullet Kim
1 month ago
test
Royalsystems blog

MCS Electronics Forum

  • BASCOM-AVR : Timer Counter Question : REPLY



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

  • Various : Ben Zijlstra : REPLY



    Very sad, my condolences to his family and friends.

    Ben was always very helpful, and never condescending or hostile, he was a great role model.

    He will truly be missed.

    JC

  • BASCOM-AVR : Can't perform conditionals on a Single? : REPLY



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

  • BASCOM-AVR : Timer Counter Question : REPLY



    Simple frequency meter on Atmega8

    '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

  • BASCOM-AVR : Timer Counter Question : REPLY



    It Was easy.
    ''''''''''''''''''''''''''''''''''''''
    $regfile = "m8def.dat"
    $crystal = 8000000
    Config Portb.5 = Output
    Config Timer2 = Timer , Prescale = 256
    On Timer2 Timer2isr
    Enable Interrupts
    Enable Timer2
    Timer2 = 0
    Do
    'main program loop
    Loop

    Timer2isr:
    Toggle Portb.5
    Return

    Thanks

  • Various : Ben Zijlstra : REPLY



    i followed ben's site with great interest and I am saddened to hear of his passing - my condolences to his family and his great friends here and elsewhere.

  • BASCOM-AVR : Bootloader update : REPLY



    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.


    Best, michael

  • BASCOM-AVR : Bootloader update : REPLY



    thats what i was thinking.

  • BASCOM-AVR : Bootloader update : REPLY



    Hi,

    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.

    Regards
    Ian Dobson

  • BASCOM-AVR : Bootloader update : REPLY



    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.

| Date published: not known
Back to newsfeed list
Welcome
Username or Email:

Password:




[ ]
[ ]
Headlines

»BASCOM-AVR : Timer Counter Question : REPLY
[quote:652023e230]PostPosted: Sun Jul 23, 2017 8:31 pm Post subject: Simple frequency meter on Atmega8 Simple frequency meter ...
»Various : Ben Zijlstra : REPLY
Very sad, my condolences to his family and friends. Ben was always very helpful, and never condescending or hostile, he was a g...
»BASCOM-AVR : Can't perform conditionals on a Single? : REPLY
[quote:73880b3574="KenHorse"]While I appreciate the previous responses, they really didn't address why the problem is happening ON...
»BASCOM-AVR : Timer Counter Question : REPLY
Simple frequency meter on Atmega8 'this program is tested on PROTEUS 'Inject pulse between range 500 to 31k hertz to PD4 $...
»BASCOM-AVR : Timer Counter Question : REPLY
It Was easy. '''''''''''''''''''''''''''''''''''''' $regfile = "m8def.dat" $crystal = 8000000 Config Portb.5 = Output Config ...
»Various : Ben Zijlstra : REPLY
i followed ben's site with great interest and I am saddened to hear of his passing - my condolences to his family and his great fr...
»BASCOM-AVR : Bootloader update : REPLY
Hi Neil, for a project of mine, i was using an external serial flash "ESF" with 512KB. (AT45DB041B) There is one emergency Syste...
»BASCOM-AVR : Bootloader update : REPLY
thats what i was thinking.
»BASCOM-AVR : Bootloader update : REPLY
Hi, We even sent one of these boxes to a customer (high security zone where the service guys have no access and the customer di...
»BASCOM-AVR : Bootloader update : REPLY
hi Ian, thats exactly the info i needed. Thanks. i have about 40 devices out in the feild, and they each have a hex b...


Date published: not known
Details

»DHT22 Programm
Könnte jmd bitte das Programm vom DHT22 hochladen? Im letzten Forum gab es ein verständliches, kurzes. Ich weiß leider nicht mehr von wem dieses wa...
»Byte Array senden über USB mit AT90USB162
Hallo, wie kann ich ein Byte Array anlegen, den ich dann praktisch über die USB sende? im folgenden ist das die im Original. BASCOM-Quellcode (11 ...
»Unterprogramm stört andere Programmabschnitte
Ich hab ein eigenartiges Problem. Mein Programm soll daten aus Sensor abfragen und dann auf einer 7-Segmentanzeige anzeigen. Das funktioniert gena...
»Atmega 328pb
Hallo Mitglieder, ich wollte den Atmega 328pb mit Bascom benutzen, finde aber nirgends den Eintrag für die $regfile = "m328 ???.dat" Definition Was...
»Strom messen bei PWM
Hallo zusammen bin gerade dabei eine Schaltung zu testen dabei wird ein BTS555 über PWM und einem TC4420 angesteuert. Config Timer1 = Pwm , Pwm =...
»EV Ladestation: Idee für automatische Parallelschaltung
Mein E-Fahrzeug wird über eine Schuko-Steckdose geladen da ich unterwegs gerne an einer Ladesäule auftanken möchte habe ich mir einen Adapter von T...


Date published: Tue, 25 Jul 2017 05:18:52 +0000
Details

»93c46 editor programmer bascom & vb93c46 editor programmer bascom & vb

»93c46 Bascom & VB693c46 Bascom & VB6

»Analog clock on SSD1289 3.2" 240x320 lcdAnalog clock on SSD1289 3.2" 240x320 lcd

»Nextion HMI lcd with KaraDio the best webradio esp8266Nextion HMI lcd with KaraDio the best webradio esp8266

»Adding 240x320 lcd to the WifiWebRadioAdding 240x320 lcd to the WifiWebRadio

»IV-17 Nixie clock GPS set time & date at power onIV-17 Nixie clock GPS set time & date at power on



Date published: not known
Details

»R.I.P Ben Zijlstra
Remembering Ben Zijlstra We hope that people who love Ben will remember and celebrate his life. more info at MCS www.mcselec.com/index2.ph...
»KaRadio webradio ESP8266
The Dimitris board is available at https://github.com/dsaltas/WiFi-WebRadio  This is a hardware project for Ka-Radio
»93C46
small tool to edit 93C46 eeprom written in BascomAVR & VB  Bascom control the 93C46 so we sent data via comport from VB code will be added later ...
»nRF24L01+ RC Controller
This is a RC controller TX & RX unit with nRF24L01+ nRF24L01+ / with PA and LNA for longer range facts: TX 1 x potmeter for servo ...
»RAW lcd
Connecting RAW lcd to atmega8 the lcd is 6 digit + time glass LCD Hour Meter for  tractor ,air compressor, ect the lcd have 4 com pins  & 14...


Date published: not known
Details


Proudly powered by e107 which is released under the terms of the GNU GPL License.