Author Topic: LED indicator for data pin  (Read 1069 times)

0 Members and 1 Guest are viewing this topic.

Offline Lucky-LukaTopic starter

  • Supporter
  • ****
  • Posts: 240
  • Country: it
LED indicator for data pin
« on: June 24, 2019, 09:55:08 am »
Hi all
I would like to understand the connections that allow leds to blink as Tx and Rx are working in a serial communication.
In the video I show what I mean.
I have a connection between a FPGA and a breadbord with a PIC.
I want to include in my pic board the little board with the max3232 so I was wondering how to connect leds to show when some data is flowing.
Are they in parallel with data lines? In such a way don't they change signal levels?
Cheers

https://youtu.be/kKMO86WT7o4
Memento audere semper.
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4705
  • Country: au
  • Question Everything... Except This Statement
Re: LED indicator for data pin
« Reply #1 on: June 24, 2019, 10:58:48 am »
In general they are in parrellel with the data lines, as most TTL signalling is active low, they have a pullup from positive to limit there current to 0.5-2mA, and when the RX or TX goes to ground they light up.
 
The following users thanked this post: Lucky-Luka

Offline Lucky-LukaTopic starter

  • Supporter
  • ****
  • Posts: 240
  • Country: it
Re: LED indicator for data pin
« Reply #2 on: June 24, 2019, 12:42:23 pm »
Hi
so, if I've correctly understood, I should do something like the attached image (image found on internet).
Am I right?
Cheers
Memento audere semper.
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4705
  • Country: au
  • Question Everything... Except This Statement
Re: LED indicator for data pin
« Reply #3 on: June 24, 2019, 12:43:40 pm »
You want the top half of the image, not the lower half
 

Offline Lucky-LukaTopic starter

  • Supporter
  • ****
  • Posts: 240
  • Country: it
Re: LED indicator for data pin
« Reply #4 on: June 24, 2019, 12:46:54 pm »
With the top half part of the image don'tI change the level of the pin input?
btw which R value should I use?
Cheers
Memento audere semper.
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4705
  • Country: au
  • Question Everything... Except This Statement
Re: LED indicator for data pin
« Reply #5 on: June 24, 2019, 01:15:43 pm »
It will change the level, how much comes down to your exact schematic.

TTL idles high, if both devices have the same IO voltage, e.g. 3.3V, all is happy, they pull down to ground to send bits of data

So when the bus is not doing anything, and the LED is connected to that same voltage, in this case 3.3V, it is off, no change to the signal what so ever

Now when it pulls the bus low, then the LED is on, its loading the signal with some current so its going to be a little higher from ground than it would be without the LED, but we can calculate what we can get away with.

now your little PIC micro, It should at the worst case be able to sink 10mA on a given pin to ground with some very tiny offset voltage from ground (can be higher, but lets say 10mA to cover almost all cases), so aslong as what else your hanging off that pin does not let more than 10mA flow into the pin to ground, your good,

I imagine your FPGA like any other IC set up with an input will be drawing down in the nA - single digit uA currents, so that can be ignored, leaving mainly the LED,

So we need the LED to have less than what the pin can sink flowing through it, as its just an indicator LED, 0.5mA for indoor would be more than bright enough, for outdoor may need 2-5mA, still less than that arbitary 10, so in the clear

now for calculating the resistor, lets just say its a normal green LED for both, so about 2.4V dropped by the LED, so 3.3V - 2.4V = 0.9V we need to burn off in the resistor, lets say we want 2mA, well R = V/I so 0.9 / 0.002 = 450 ohms, round to a common value, say 470 ohms, and there you go, a bright LED that does not overload your pins

The datasheets of your devices will tell you the maximum current each pin can sink (or source), and will probably even have a graph buried somewhere about output voltage vs current if you really want to doublecheck the datasheet, if they are all within spec, then your good and it will work.
 
The following users thanked this post: Lucky-Luka


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf