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

This page ever ...
total: 42
unique: 26

Site ...
total: 4002
unique: 2216
Online
  • Guests: 1
  • Members: 0
  • Newest Member: ole
  • Most ever online: 47
    Guests: 47, Members: 0 on Wednesday 21 February 2018 - 23:52:15
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 year ago
test
Royalsystems blog

MCS Electronics Forum

  • BASCOM-AVR : 1PPS signal Int2 : REPLY



    Nice!
    I was in fact considering the DB series for the new design. They have a lot of peripherals.

  • BASCOM-AVR : 1PPS signal Int2 : REPLY



    Don't forget that the new AVR DB series also has the ability to run on both 3V and 5V at the same time.

    One of the ports can run on 3V, with the chip on 5V, and the level conversion is done for you, inside the micro.

    JC

  • BASCOM-AVR : 1PPS signal Int2 : REPLY



    Try putting a diode (or two) in between the output of the GPS and the input to the micro (cathode to the GPS, anode to the micro). This should raise the input voltage on the micro (with a pull up) enough to let it work.

  • BASCOM-AVR : 1PPS signal Int2 : REPLY



    Better try simplest level shifter on that one line. There is toons of similar schematics. Search for "level shifter" or "level converter"
    [img:cb4b7e60d3]https://www.mcselec.com/userpix/22760_shifter_1.jpg[/img:cb4b7e60d3]

  • BASCOM-AVR : 1PPS signal Int2 : REPLY



    Hi,

    I did try week pull ups and pull downs. The only thing that solved the problem was using the same power line (3.3V).
    Agree that mixing logic leves is nor a good idea. More and more peripherals are becoming 3.3v now. I will change my boards to use only 3.3v.
    The only downside I see is that the RS232 and RS485 drivers and the RTC's are much more expensive in their 3.3V versions.

    Thanks all for the answers. Appreciated.

    JB

  • BASCOM-AVR : 1PPS signal Int2 : REPLY



    Those are characteristics for Mega324.
    0.6Vcc for the 5V power supply not means 0.6V It means 5V * 0.6 = [b:f26dff7c2e]3V[/b:f26dff7c2e]

    [img:f26dff7c2e]https://www.mcselec.com/userpix/22760_dc324_1.jpg[/img:f26dff7c2e]

    Some modules have only Open Collector so some pullup must be done but you cant use internal from the Mega because 5V.
    You can try pullup it into 3V3.

  • BASCOM-AVR : 1PPS signal Int2 : REPLY



    Logic levels is probably your problem. Even though the data sheet says that at Vcc of 5v, 2.6v is treated as logic high and 2.2 is a low, Im wondering if your GPS output is outside this range. Have you tried a weak pullup or pulldown on the mega input that is looking at the GPS signal? What does the pulse look like on a scope?
    It is a simple matter to use a FET as a logic level shifter. It is bad practice to mix logic levels.

  • BASCOM-AVR : 1PPS signal Int2 : REPLY



    Hi All,

    Thanks for all the awnsers.
    The 1PPS pulse is 100ms.

    But, seems that the proble is electronic and not software related.


    I have the system powered from 5V and the GPS module is 3.3V, so I have an internal 3.3v regulator to power the GPS
    Since the ATMEGA can take logic levels of 3.3V I dind't see a problem. In fact I have several boards that use this same setup (but don't use interrupts) that work just fine.

    If the system is powered from 3.3V (atmega and GPS, it works).
    I don't understand why. Somebody that knows more electronics than I do please explain...

    Thanks

  • BASCOM-AVR : 1PPS signal Int2 : REPLY



    How long is the 1PPS pulse of yor GPS Device? At least 50ns is needed for MEGA324A. Maybe your optocoupler works because the pulse is stretched by this relatively slow device.

  • BASCOM-AVR : 1PPS signal Int2 : REPLY



    Here is the code I am using to count rain pulses from a rain gauge and wind speed pulses from an anemometer. The wind pulses are 4.8ms wide and can occur several times pe second.
    Rain pulse is 20 mS and only x1 every 1 min or so in heavy rain.
    The processor is the atmega1284p



    [code:1:8704c53005]

    'Initialize interrupts for wind input on pin A.4 (PA4, PC Int0)
    ' rain on PCI3 wind is on PCI4

    pcmsk0 = &B00011000 'enable PCI3(rain) and PCI4(wind speed pulse)
    PCICR = &B00000001 'enable PC Int0
    on PCint0 count_anemometer saveall 'no brackets - must look like a label


    '***********************************************
    sub count_anemometer()


    'rainswitch = tipping bucket rain gauge
    if rainswitch = 0 then

    if dn15 = 0 then

    rainsng = rainsng + rain_bucketsize
    Totalrainsng = Totalrainsng + rain_bucketsize 'rain in last 24 hrs
    print #1, "rain";Totalrainsng
    end if

    dn15 = 1

    else
    dn15 = 0
    end if

    'windswitch = anemometer lo going, normally hi
    if windswitch = 0 then

    if dn16 = 0 then
    incr windpulsecountw
    Toggle Wind_led
    end if
    dn16 = 1

    else
    dn16 = 0
    end if


    end sub
    '***************************************

    [/code:1:8704c53005]

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

Password:




[ ]
[ ]
Headlines

»BASCOM-AVR : 1PPS signal Int2 : REPLY
Nice! I was in fact considering the DB series for the new design. They have a lot of peripherals.
»BASCOM-AVR : 1PPS signal Int2 : REPLY
Don't forget that the new AVR DB series also has the ability to run on both 3V and 5V at the same time. One of the ports can ru...
»BASCOM-AVR : 1PPS signal Int2 : REPLY
Try putting a diode (or two) in between the output of the GPS and the input to the micro (cathode to the GPS, anode to the micro)....
»BASCOM-AVR : 1PPS signal Int2 : REPLY
Better try simplest level shifter on that one line. There is toons of similar schematics. Search for "level shifter" or "level con...
»BASCOM-AVR : 1PPS signal Int2 : REPLY
Hi, I did try week pull ups and pull downs. The only thing that solved the problem was using the same power line (3.3V). Agree...
»BASCOM-AVR : 1PPS signal Int2 : REPLY
Those are characteristics for Mega324. 0.6Vcc for the 5V power supply not means 0.6V It means 5V * 0.6 = [b:f26dff7c2e]3V[/b:f26...
»BASCOM-AVR : 1PPS signal Int2 : REPLY
Logic levels is probably your problem. Even though the data sheet says that at Vcc of 5v, 2.6v is treated as logic high and 2.2 ...
»BASCOM-AVR : 1PPS signal Int2 : REPLY
Hi All, Thanks for all the awnsers. The 1PPS pulse is 100ms. But, seems that the proble is electronic and not software rel...
»BASCOM-AVR : 1PPS signal Int2 : REPLY
How long is the 1PPS pulse of yor GPS Device? At least 50ns is needed for MEGA324A. Maybe your optocoupler works because the pulse...
»BASCOM-AVR : 1PPS signal Int2 : REPLY
Here is the code I am using to count rain pulses from a rain gauge and wind speed pulses from an anemometer. The wind pulses are ...


Date published: not known
Details

»aktuelles PC Datum im Quellcode einpflegen
Liebe Forenmitglieder, ihr habt euch doch bestimmt auch schon öfter mal gewünscht, das Aktuelle PC Datum und die Uhrzeit in euren Bascom Quellcode...
»Upload- Probleme
Hallo zusammen, mich narrt mal wieder ein Controller. Es ist mir zwar gelungen, den Atmega 16 erstmalig zu flashen, Weitere Versuche werden allerd...
»E-Paper Display mit partiellen Updates
Hallo, hatte vor kurzen drei E-Paper Displays mit partielle Update zum testen bekommen. Bisher musste der gesamte Inhalt bei einem Bildwechsel er...
»Bootloader stoppt Mikrocontroller
Hallo alle zusammen, Ich hab mal wieder ein Problem, dem ich alleine nicht herr werde. Dieses mal ist es etwas seltsam, denn wenn ich den Bootload...
»Ist hier noch jemand, der AVRs mit Linux programmiert?
Mich würde interessieren wie Andere die Probleme die man dabei hat gelöst haben, bzw. könnte ich meine AVR Programmierumgebung hier vorstellen. Gem...
»Suche einen universellen AVR Programmer
Ich habe eine AVRISP MK2 und ein Dragon zum Programmieren von AVR Controllern , welche unter Windows 10 32Bit mit einigen Schwierigkeiten auch bis ...


Date published: Wed, 29 Jun 2022 07:19:57 +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

»Bascom Can Bus Sniffer
»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.