Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Clashlab

  • Rank
  1. Well, what I wanna do is control a triac for light dimming. So I need to know when the power line crosses zero. I don't need a very high accuracy, 100 ┬Ás delay will be ok. But I don't want the interrupt to occur at the peak value of the sine curve nor the interrupt occurring at very different times if the sine curve is going down or up. So using a transformer to get a 9v sine curve is not acceptable because (50Hz) : Going from 0 to 1 needs 2v (TTL) => t = arcsin( 2 / 9 )/( 2 * pi * 50 ) = 0.7 ms later Going from 1 to 0 needs 0.8v (TTL) => t = arcsin( 2 / 9 )/( 2 * pi * 50 ) =
  2. They did answer me: So I will not use that method. Instead I will connect the power line thru a resistor to a NOT gate (which allows exceeding the voltage specifications as long as the current specification is meet, i.e. SN74AHC1G04) and connect that output to the pic (also thru a resistor).
  3. Hi, I would like to know if I can use the method described in AN521 to detect the power line zero crossing (that is using only a resistor) on a 16F88 using portB pin 7. I don't see the diodes on the datasheet schematic for that pin so I am wondering if I have to put them outside the pic. The reason I choose portB pin 7 is because I need an interrupt on change. Thanks
  4. Ok, I will try this! I should have read the datasheet more deeply. Thanks a lot!
  5. Hi, The way I connected the led to the pic is very simple: PIC (5v) ---- Resistor (470 Ohm) ---- Led ---- 0v I tried several other value for the resistor, form 47 Ohm to 2.7 kOhm but that doesn't change anything. I think your right about the origin of my problem, it explain the two situation I encountered. I also found that RA4 on a 16f88 is a schmitt trigger, but using RA3 (TTL) doesn't help. So how can I make sure that when I put a 1 on the led output I read a 1 after?
  6. Hello, In am experiencing a wired problem trying to make a led blink. I what to use a timer (TMR0) to know when I need to change the led state. So I have a function that turns on the led and sets the timer. Then every 20 timer overflow I test the led state and change it. This is where I have a problem. When I am directly testing the led state, the led never blinks (it is like reading the led state always returns 0) so I need to use a variable to keep track of the led state. I really don't understand the problem and need your help to figure this out. Here are the files (led.h,
  • Create New...