View previous topic :: View next topic |
Author |
Message |
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Sat Sep 19, 2015 5:35 pm Post subject: Some more checks |
|
|
Could you do a simple test to activate the relay? We haven't seen any schematic yet so you should do a little test just a set and reset of portc.0 with a wait. If the relay is working.
And there are still some unanswered questions:
Would like to see the c1raw after the getadc(0)
We haven't seen how you connected porta.0
Is AVCC connected to VCC?
Check the jtag fusebits. The datasheet tells this is part of the hardware i2c bus.
I hope you are using a driver to drive the relay.
Ben Zijlstra |
|
Back to top |
|
|
naseerak
Joined: 08 Nov 2008 Posts: 138
|
Posted: Sat Sep 19, 2015 6:25 pm Post subject: |
|
|
Schem here |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Sat Sep 19, 2015 7:11 pm Post subject: |
|
|
Enough hardware to do some serious testing.
As suggested could you do a
Code: |
Config portc.0 = output
Do
Set portc.0
Wait 1
Reset portc.0
Wait 1
Loop
End
|
To test the working of the relay. It should change every second. You will know if the driver is working and that your 8 MHZ clockspeed is oke.
And with your original program:
And if the LCD is working send the c1raw value to the LCD and turn the potmeter to check if you get different values.
Have fun
Ben Zijlstra |
|
Back to top |
|
|
Evert :-)
Joined: 18 Feb 2005 Posts: 2156
|
|
Back to top |
|
|
naseerak
Joined: 08 Nov 2008 Posts: 138
|
Posted: Sat Sep 19, 2015 9:08 pm Post subject: |
|
|
GND pin is always hidden in proteus ISIS you know that but is supposedly tied to GND sybol, i confirmed it in layout where it is connected...
regards.. |
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
Posted: Sun Sep 20, 2015 2:53 am Post subject: |
|
|
There is an error in your button scheme .
Those who have to work 're connection types for the buttons , which is always logical 1
(5V ) and when pressed switches to logic zero ( 0V ) , and that
It is in logical zero and
when you press for one logical......... |
|
Back to top |
|
|
naseerak
Joined: 08 Nov 2008 Posts: 138
|
Posted: Sun Sep 20, 2015 6:32 pm Post subject: |
|
|
Buttons are working fyn, the port pins remains high and are not changing level.
regards.. |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Tue Sep 22, 2015 1:01 pm Post subject: test? |
|
|
Any luck with the hardware tests?
Have fun
Ben Zijlstra |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Tue Sep 22, 2015 1:06 pm Post subject: test? |
|
|
Any luck with the hardware tests?
Have fun
Ben Zijlstra |
|
Back to top |
|
|
naseerak
Joined: 08 Nov 2008 Posts: 138
|
Posted: Tue Sep 22, 2015 4:33 pm Post subject: |
|
|
Thanks for the concern Making a new HW will inform you soon, Implementing RC filters on ADC pins, I am using PC power supply ant its voltage are a bit high without load I am also implementing a bleeder type resistor to stabilize the voltage....
My other question regarding.
Code:
Config portc.0 = output
Do
Set portc.0
Wait 1
Reset portc.0
Wait 1
Loop
End
why there are two wait 1
I tried with with one WAIT 1 and the port remained high, supposedly there should be One WAIT 1 as the loop will pass throgh it again and again.
regards.. |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Tue Sep 22, 2015 7:16 pm Post subject: relay on | 1 second wait | relay off | 1 second wait | relay |
|
|
relay on
wait 1 second
relay off
wait 1 second
relay on
wait 1 second
relay off
wait 1 second
relay on
wait 1 second
relay off
wait 1 second
relay on
wait 1 second
relay off
wait 1 second
relay on
wait 1 second
relay off
wait 1 second
etc etc
Doesn't look very strange to me.... If you test it like this and hear a click of the relay every second, than you will know that the relay driver is working and that the fuse settings for this microcontroller (for the internal clock) are oke.
Quote: | I tried with with one WAIT 1 and the port remained high |
What will this tell us, by not using a wait 1, the set/reset or reset/set is going so quick that the relay stays on or off... and using voltmeter will not show any change on the port. Use the 1 second twice and you will have time to hear and to measure something.
Ben Zijlstra |
|
Back to top |
|
|
naseerak
Joined: 08 Nov 2008 Posts: 138
|
Posted: Sun Sep 27, 2015 3:54 pm Post subject: |
|
|
Thanks
the ULN2803 is working fine and the relays work on PORTC.
the other relay on PORTD.6 is not working using a 2sc1383 a 1K resistor on its base. the voltage on this pin remains 1.25v even in off condition and the relay is not switching..
regards.. |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Sun Sep 27, 2015 4:16 pm Post subject: Oke |
|
|
That sounds good!! Perhaps you can put the getadc(0) value on the LCD display to check that as well.
"You don't get what you expect, you get what you inspect"
Have fun
Ben Zijlstra |
|
Back to top |
|
|
naseerak
Joined: 08 Nov 2008 Posts: 138
|
Posted: Sun Sep 27, 2015 5:33 pm Post subject: |
|
|
ALL works fine now except the problem with portd.6 any idea? |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Sun Sep 27, 2015 6:37 pm Post subject: |
|
|
Code: | config portd.6 = output
do
set portd.6
wait 1
reset portd.6
wait 1
loop
end
|
Check with a voltmeter on the microcontroller pin if you get a 0 and 1.
Have fun
Ben Zijlstra |
|
Back to top |
|
|
|