Show Posts
Pages: [1] 2 3 ... 12
1  Using Arduino / General Electronics / Re: I have a dubt about Schmitt Waveform Generator on: July 19, 2014, 11:40:21 am
You probably need to add a trimmer potentiometer.
Once I find the correct combination I will use a resistor. Don't need no variable stuff in this case.

Quote
38KHz carrier? That sounds like IR remote control ...
Exactly! You are spot on :-)

Everything started with me trying to clone an IR Remote Control. I got it working with a library, a little investigation, and an Arduino UNO equipped with an IR Led and a resistor.

From there on I got into oscillators and waveforms, I wanted to learn more and I started reading about the simplest circuits that could produce such things.

Now I'm going to learn how to superimpose a low freq signal generated with an Atmega328 on top of a 38kHz carrier (or the opposite, you know what I mean ... IR marks and spaces) made with the above mentioned gate.
2  Using Arduino / General Electronics / Re: I have a dubt about Schmitt Waveform Generator on: July 19, 2014, 11:10:00 am
It says:-
Quote
The Schmitt waveform generators circuit for the CMOS 40106 is basically the same as that for the previous TTL 74LS14 inverter, except for the addition of the 10kΩ resistor which is used to prevent the capacitor from damaging the sensitive MOSFET input transistors as it discharges rapidly at higher frequencies.
But I don't see the point. It is not as if the capacitor discharges through the input pin. The discharge path is through the other resistor to the output. I can not see what they are on about.
Otherwise the rest of the stuff looks fine, and I won't do any harm having that resistor in there.

Thank you Mike, you are precious as always :-)

In the meanwhile, I run the circuit with both a HEF40106B and a SN74HC14 (both are Schmitt trigger inverter) with consistent results. I will fix the freq manually finding out which RC combination gets me the 38kHz Carrier I am looking for.
3  Using Arduino / General Electronics / Re: I have a dubt about Schmitt Waveform Generator on: July 19, 2014, 10:02:19 am
Quote
You mean "the 10kΩ resistor which is used to prevent the capacitor from damaging the sensitive MOSFET input transistors ..." makes no sense to you?
No absolutely no sense, why would it protect anything and from what?

Mmhh ... ok.

Anyway, apart from that, would you say that the article http://www.electronics-tutorials.ws/waveforms/generators.html has to be taken seriously? Or should I be skeptical about what it states? It's all relatively new to me, so I'd better learn something meaningfull in the first place and not waste my time on questionable theses.
4  Using Arduino / General Electronics / Re: No mistake. on: July 19, 2014, 09:36:19 am
Clearly you simply have to "tweak" the values - generally the resistor - to get the desired frequency.
I can live with that :-)
Quote
I am scratching my head at the explanation for the presence of the 10k resistor; there may be some reason for it, possibly to do with powering the circuit off, but that given is nonsense.
You mean "the 10kΩ resistor which is used to prevent the capacitor from damaging the sensitive MOSFET input transistors ..." makes no sense to you?
5  Using Arduino / General Electronics / Re: I have a dubt about Schmitt Waveform Generator on: July 19, 2014, 08:00:02 am
9.0 / 5.0 = 1.8
1.2 / 0.7 = 1.7
I suspect those values are too similar for it to be a coincidence.

I thought about that too. Other than being a supposition ... any direct evidence/explanation? :-)
6  Using Arduino / General Electronics / I have a dubt about Schmitt Waveform Generator on: July 19, 2014, 06:54:02 am
Hallo everybody,
 I am approaching waveform generation and stuff like that. So i came to this article http://www.electronics-tutorials.ws/waveforms/generators.html which I find interesting  :-) But things don't work like exposed :-(

I wired immediately the "CMOS Schmitt Waveform Generator" circuit (in order to get an Astable Multivibrator):

using a 5V DC supply (not 9V like the example) and using a CY7C68013A Mini Board Digital Analyzer (I don't have an oscilloscope) to inspect the generated wave. As of now I'm mostly interested in getting a steady square wave at a constant frequency. So I'm trying to get the desired frequency first ... but I don't :-(

The problem to me is that the article says I should get a frequency  f = 1 / (1.2 * R * C) but I get  f ~= 1 / 0.7 (R * C) instead.

The wave seems to be quite steady, with a duty cycle close to 50%, which is good :-) but the frequency if somewhat off. I used various combinations of R and C, always producing quite the same result. I decoupled the 5V supply, and grounded every unused Input of the IC.

So I wonder what's going on, maybe I am missing something? Is this maybe related to the "propagation delay" that changes with Vdd?

I'd be quite happy to use the circuit as it is right now (with the "corrected" formula) but only if that doesn't hide some mistake on my behalf.
7  Using Arduino / Networking, Protocols, and Devices / Re: Arduino UNO SPI Library + MCP3208 : request for suggestions on: January 10, 2014, 08:29:52 pm
I totally nailed the linearity issue with a Unity Gain Amplifier :-)

This is what I get now:


I couldn't be more happy with the result :-)
Now I got full linearity on the whole analog input range! An LM358 in Unity Gain AMpli configuration did the trick on the input channel being fed to mcp3208. Well I still have to power the OpAmp with more then 5V ... which is a new issue I have to attack now, I'd really love to settle down on a single 5V power supply only :-(
8  Using Arduino / Networking, Protocols, and Devices / Re: Arduino UNO SPI Library + MCP3208 : request for suggestions on: January 09, 2014, 09:08:53 am
What voltage are you actually feeding into the device ?

I'm feeding it with 5V from Arduino itself. I have a cheap voltmeter, so my 4.90V reading maybe inaccurate but still pretty close to 5.0V. I consider that a minor issue. I'm more concerned with the non-linearity of the last part of the curve at values higher then 4.3V ... I supposed at first that the MCP3208 should output more linearly the whole range through.

I'm reading right now about a Unity Gain Amplifier, could that be related to this case? I'm still not very confident with all that low/high_impedance input stuff, I'm open to suggestions about that.
9  Using Arduino / Networking, Protocols, and Devices / Re: Arduino UNO SPI Library + MCP3208 : request for suggestions on: January 09, 2014, 09:03:58 am
12 bit  A/D  only goes to 4095  maximum output.

Well, I'm cool with that. Btw, the 4095 is confirmed, not the "zero" value, the lowest digital value I get is 3 (almost 0). But that's not an issue :-)
10  Using Arduino / Networking, Protocols, and Devices / Re: Arduino UNO SPI Library + MCP3208 : request for suggestions on: January 08, 2014, 12:53:30 pm
In the meanwhile I managed to get more linear outputs adding a bypass capacitor to the circuit as suggested in the datasheet.

That really helped a lot but not solved a rather annoying issue in the upper voltage range. I'm feeding a +5v Vref to the ADC and I get a pretty linear output in the range 0.0-4.3V but after that the linearity is lost.


I assume it's because this chip is most probably a Chinese counterfeit.
Please, someone tell me if even the genuine Microchip MCP3208 do show that curve at "high" voltage (I doubt that).
11  Using Arduino / Networking, Protocols, and Devices / Re: Arduino UNO SPI Library + MCP3208 : request for suggestions on: January 08, 2014, 10:48:35 am
I have to correct myself about the clock issue. mcp3208 is not happy with clocks under 10KHz not 10MHz. My mistake, didn't read well the datasheet. So, SPI_CLOCK_DIV4 is already good enough :-)
12  Using Arduino / Networking, Protocols, and Devices / Re: Arduino UNO SPI Library + MCP3208 : request for suggestions on: January 08, 2014, 09:53:43 am
The gap at the end is not from SPI.end() (you call that after you set CS high again) but from the call to digitalWrite().

Right, SPI.end() in the timing_graph is just a typo.

So I assume I will live with all that waste if I don't want to rewrite the lib my own, right? Not that it disturbs anything as of now :-)
13  Using Arduino / Networking, Protocols, and Devices / Arduino UNO SPI Library + MCP3208 : request for suggestions on: January 08, 2014, 08:46:57 am
Hi everybody,
 I am playing with a Microchip MCP3208 ADC SPI converter which is currently converting a 10K Pot input values to my Arduino UNO. MCP3208 is a 12bit resolution ADC, its SPI protocol needs some more bits in order to know how to answer to the Master, and I hadd to add quite a few more at the beginning in order to get those 12bits output at the end inside a few 8bits blocks to properly feed an SPI.transfer() function.

The logic analyzer shows me this:


The code generating that is:
Code:
#include <SPI.h>
#include "pins_arduino.h"

void setup (void) { }

void loop (void)
{
  byte a;
  byte b;
  byte c;
  digitalWrite(SS, HIGH);
  SPI.begin ();
  SPI.setDataMode(SPI_MODE1);
  digitalWrite(SS, LOW);    // SS is pin 10
  a = SPI.transfer(B00000110);
  b = SPI.transfer(B01000000);
  c = SPI.transfer(B00000000);
  digitalWrite(SS, HIGH);
  SPI.end();
}

I have a few questions someone may answer. Just out of curiosity. Everything works, I'd only like to know some more.

It's obvious there's no way to make spi.transfer() transfer more then 8bits at a time, and I assume there's no way to make those transfer more "tight" ... I mean, without generating those gaps between each 8bits pack, right? The mcp3208 doesn't complain, it still waits Clock signaling in order to answer back with anything at all. I'm just curious.

There's also that last gap at the end (the one where I wrote a green SPI.end()). Actually I assume It's related to digitalWrite(SS, HIGH) only. I wonder if that's a "feature" of SPI Library or just a "side effect". It's obviously not needed for the SPI to work.

Well, happy to read some hints about that.
    Cheers :-)

Actually I have another question regarding the spi_clock_divider. As I read I can only force the UNO to clock the SPI at 8MHz. SPI.setClockDivider(SET_CLOCK_DIV2) makes it clock at 16MHz/2=8MHz which is still slower then the 10MHz minimum required by MCP3208 for reliable conversions.
I already noticed some quite offset values when running at default SET_CLOCK_DIV4, I will investigate more in that but I'd really like to hear something from the community about this issue :-)
14  Using Arduino / Microcontrollers / Re: what does the atmega uc do during every clock cycle? on: July 26, 2013, 05:28:59 am
This is all much easier to grasp on something like a PDP11, where the PC and SP are just ordinary registers, and there haven't been any "optimizations" done to squeeze 32 registers into 4bits of identifier in the instruction.  (or make everything happen in "one clock cycle"; it's really useful to think of multiple phases of each instruction taking "as long as needed", and letting the HW designer figure out how to make that happen in half a clock cycle.  You can probably find a good description somewhere of what an 8051 does with each of the 12 clocks that make up ONE instruction "cycle" in THAT architecture.  Or the 4 clocks of an 8080.  etc.)

I'll look into that, it may prove usefull.

Btw, if someone is familiar with Bell Labs' Cardiac ( http://www.scientificsonline.com/cardiac-illustrated-computation-aid.html ) it will be clear what I have in mind when talking about "educational approach".
15  Using Arduino / Microcontrollers / Re: what does the atmega uc do during every clock cycle? on: July 25, 2013, 04:01:02 pm
...essentially it boils down to a chip architectural question.
Right, and I'd like to be specific on the atmega family.

Quote
Some assembly language guides/books for the AVR line may also reveal specifics.
Do you reckon "Atmel AVR Microcontroller Primer: Programming and Interfacing" of Barrett and Pack, "AVR, an introductory course" of J.Morton or "AVR Mikrocontroller Praxis" of Volpe and P.Volpe are good readings in this regard?

Pages: [1] 2 3 ... 12