PDA

View Full Version : Weird flicker



The Master
- 9th December 2007, 17:05
Hi. Ive been making a circuit and ive started getting trouble with lights flickering. The chip does use PWM but the flicker is something different. The chip will work fine then for no aparent reason all the outputs will turn on and off rapidly (about 10 times a second). I had this problem when i was testing but only if i started unplugging the mains supply slowly. Could this be a brownout? The chips stop responding to the serial input. Whats the most likely cause? Programming error? Dodgy circuit?

Edit: In my circuit i have 2 chips and they both did the same thing at the same time. Weird

mat janssen
- 9th December 2007, 17:10
Show us your circuit and show us your code. The most here have no cristalball to see what you have on your desk.

mister_e
- 9th December 2007, 17:16
well, i think those having one got..
http://www.mister-e.org/Pics/CrystalBall_Informations
;)

The Master
- 9th December 2007, 17:40
Sorry. I was just asking what the most likely one would be. Heres both anyways.

Now one chip doesnt seem to be responding at all :(

mister_e
- 9th December 2007, 17:50
can you reprogram it and tell what happen with the one who stop?

Board layout won't help, if you have access to a Schematic software, this would make things easier for us. or a scan of an hand-made one.

I usually start with schematic, then i observe the board layout, and then the code.. but it's me ;)

The Master
- 9th December 2007, 18:24
I havnt got any scematic software yet. Im trying to get livewire though. I think i solved the random clicker prob. It seems that if i send chr(100) for 100% brightness the chips dont like it. I cant see why that would cause a problem but i changed the max to 99 and they dont go weird now.

I do still have a problem. Ive made a test app to send a few commands out and at one command everything sticks for a second. I think this might be to do with the app tho so hopefully ill have them all working soon :P

The chip that stopped responding was actually responding. The status light was flashing so i think it wasnt getting the right command or something. Oh well, nothing that a few late nights cant fix im sure

mister_e
- 9th December 2007, 18:36
what happen if you send 101?

The Master
- 9th December 2007, 18:44
If i send 101 in theory nothing should happen. 100 should mean its the brightest. 0 is obv off. 255 means data start and 254 means reset the address.

That program isnt quite finished. The idea is that each chip picks up 16 bytes of data. 1 chip handles the first 8 and the other handles the second lot of 8. Resetting the address should only happen if a button is being held down when the command goes out.

Ive got the lights running a test pattern now so ill see if they break

mat janssen
- 9th December 2007, 18:49
I dont see:
@ DEVICE PIC16F???,XT_OSC
@ DEVICE PIC16F???,HS_OSC
etc,ect.
in your code

mister_e
- 9th December 2007, 18:52
maybe i've misunderstood something but


if recpos=18 then
if indata<100 then
address=indata
write 0, address
for y=1 to 10
high portb.6
high portb.7
pause 20
low portb.6
low portb.7
pause 20
next
high portb.6
else
low portb.6
for y=1 to 10
high portb.7
pause 20
low portb.7
pause 20
next
high portb.6
endif
recpos=16

The Master
- 9th December 2007, 18:58
All fuses are set in the programmer software. I did have problems with them but now ive set them correctly it works.

That section of code your looking at is to reset the address. It only runs if RecPos=18. RecPos is only set to 18 if chr(254) arrives. That check is so the address must be less than 100. Well, i dont think ill be making 100 boxes that each have 16 chanels. 1600 sets of lights :D a nice thought but a little out of my price range. Hehe

Edit: Those loops just make the lights flash either orange or red depending if the address was ok or not ok