Pages: [1]   Go Down
Author Topic: Uno + GLCD + 2 Buttons = Frequency Generator 0 Hz -1 MHz  (Read 4433 times)
0 Members and 1 Guest are viewing this topic.
Germany
Offline Offline
Edison Member
*
Karma: 137
Posts: 1551
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As an example I added a frequency generator to http://code.google.com/p/m2tklib/ (GLCD version of m2tklib).
Only a graphics display and some input buttons are required for a nice frequency generator with adjustable duty. The display also shows the hardware values, because not all values can be created by the ATMEGA.



Oliver
Logged

Greenville, IL
Offline Offline
Edison Member
*
Karma: 15
Posts: 1330
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


  Nice job! That could be very useful!

Mark
Logged


Offline Offline
Full Member
***
Karma: 5
Posts: 222
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hallo Oliver,
Dein Projekt ist genau das, was ich gesucht habe, Danke dafür.

Leider funktioniert (bei mir) irgendetwas nicht richtig.
Arduino 1.0.1 und m2tklib_arduino_glcd_1.08. der Rahmen um die Eingabefelder ist viel zu klein, Real Freq und Real Duty = 0
Arduino 1.0.1 und m2tklib_arduino_glcd_1.05. der Rahmen um die Eingabefelder passt, Real Freq und Real Duty = 0, Lautsprechen an Pin 3 kein Signal

es wäre toll, wenn es dafür eine Lösung gibt.

Gruss
Kurti


Logged

Zitat Jurs: falsche Verkabelung ist sowieso immer wenig förderlich für das Funktionieren der Hardware

Germany
Offline Offline
Edison Member
*
Karma: 137
Posts: 1551
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hallo Kurti

Please excause for switching back to english.

Many many thanks for reporting that bug. I have corrected M2tklib and uploaded the new release 1.08.1
Please download v1.08.1 from http://code.google.com/p/m2tklib/downloads/list.

I have verified that the singal is available at pin 3 (Arduino Duemilanove)

Thanks,
Oliver
Logged

Washington
Online Online
God Member
*****
Karma: 39
Posts: 808
Firefox & Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It looks like you are driving an 8 ohm speaker directly from an Arduino pin.
The datasheet recommends no more then 40mA per pin. 5v / 8 ohms = 625mA. Far too high.
I recommend putting a resistor of around 220 ohms in series but even 100 ohms will be better then nothing.
Better yet is to use a transistor driver with base resistor.
Logged

Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

Offline Offline
Full Member
***
Karma: 5
Posts: 222
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I got it, it's working !

the program is:
uint8_t uiKeySelectPin = 0;
uint8_t uiKeyDownPin = 1;
uint8_t uiKeyUpPin = 2;

the function is:
Switch at pin 0 = +1 and Enter
Switch at pin 1 = select
Switch at pin 2 = no function

You have to push the select-button to put the cursor to the right position.
Then push the +1 button to select the number.
After making the setting push the select button until Apply is highlighted.
Then push the +1 button ( enter )

Thanks for this sketch
Kurti
Logged

Zitat Jurs: falsche Verkabelung ist sowieso immer wenig förderlich für das Funktionieren der Hardware

Germany
Offline Offline
Edison Member
*
Karma: 137
Posts: 1551
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@smeezekitty

You are right, the resistor will add some safety to the hardware. However, to my knowledge, the current is also limited by the controller itself.


@kurti

In order to use all three buttons, you need to exchange the button handler. Instead of
M2tk m2(&top_el_gridlist, m2_es_arduino, m2_eh_2bs, m2_gh_glcd_ffs);
use
M2tk m2(&top_el_gridlist, m2_es_arduino, m2_eh_4bs, m2_gh_glcd_ffs);

Oliver
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 222
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I tried your fix and it's working, the switch at pin 2 has a function.

I checked the signal at pin 3 with my osci:
- the calculation of the real duty has nothing in common with the signal
( Test 300 Hz, 50 Duty -> Real Freq.: 300, Real Duty 102, Frequency changed to 800 Hz, Real Duty changes to )
- the Frequency Generator only works above 60 Hz

Thanks for your tries
Kurti
Logged

Zitat Jurs: falsche Verkabelung ist sowieso immer wenig förderlich für das Funktionieren der Hardware

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Guys,

Interesting project.
Where do I get the GLCD library & will it work with the Adafruit 1.8" ST7735 TFT LCD? This display uses same SPI interface pins.
If display won't work with GLCD library then could I substitute the Adafruit GFX.h , Adafruit St7735.h and SPI.h

My project is to generate 0-200 pulses per second with display. Uno will be driving speaker with transistor driver. An ultrasonic cardiac transducer will be placed on thin foam on top of speaker and pulses used to simulate pulse detection. I have already made a simple version using 555IC, but stability is not high & no digital display.

Any tips would be appreciated.

cheers,
Bruce
Logged

Germany
Offline Offline
Edison Member
*
Karma: 137
Posts: 1551
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The graphics library is here: http://code.google.com/p/glcd-arduino/
The display is a simple KS0108 based monochrome display.

Oliver
Logged

Pages: [1]   Go Up
Jump to: