Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Comparison on Singles..
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Sat Sep 19, 2015 5:35 pm    Post subject: Some more checks Reply with quote

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
View user's profile Visit poster's website
naseerak

Bascom Member



Joined: 08 Nov 2008
Posts: 138

pakistan.gif
PostPosted: Sat Sep 19, 2015 6:25 pm    Post subject: Reply with quote

Schem here
Back to top
View user's profile
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Sat Sep 19, 2015 7:11 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2130

netherlands.gif
PostPosted: Sat Sep 19, 2015 7:36 pm    Post subject: Reply with quote

Where's pin9 (gnd) of the uln2803 connected to? Don't see it in the schematic.
_________________
www.evertdekker.com Bascom code vault
Back to top
View user's profile Visit poster's website
naseerak

Bascom Member



Joined: 08 Nov 2008
Posts: 138

pakistan.gif
PostPosted: Sat Sep 19, 2015 9:08 pm    Post subject: Reply with quote

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
View user's profile
Printpix52

Bascom Member



Joined: 18 Jun 2014
Posts: 248
Location: D.F.

mexico.gif
PostPosted: Sun Sep 20, 2015 2:53 am    Post subject: Reply with quote

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
View user's profile
naseerak

Bascom Member



Joined: 08 Nov 2008
Posts: 138

pakistan.gif
PostPosted: Sun Sep 20, 2015 6:32 pm    Post subject: Reply with quote

Buttons are working fyn, the port pins remains high and are not changing level.
regards..
Back to top
View user's profile
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Tue Sep 22, 2015 1:01 pm    Post subject: test? Reply with quote

Any luck with the hardware tests?

Have fun
Ben Zijlstra
Back to top
View user's profile Visit poster's website
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Tue Sep 22, 2015 1:06 pm    Post subject: test? Reply with quote

Any luck with the hardware tests?

Have fun
Ben Zijlstra
Back to top
View user's profile Visit poster's website
naseerak

Bascom Member



Joined: 08 Nov 2008
Posts: 138

pakistan.gif
PostPosted: Tue Sep 22, 2015 4:33 pm    Post subject: Reply with quote

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
View user's profile
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Tue Sep 22, 2015 7:16 pm    Post subject: relay on | 1 second wait | relay off | 1 second wait | relay Reply with quote

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
View user's profile Visit poster's website
naseerak

Bascom Member



Joined: 08 Nov 2008
Posts: 138

pakistan.gif
PostPosted: Sun Sep 27, 2015 3:54 pm    Post subject: Reply with quote

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
View user's profile
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Sun Sep 27, 2015 4:16 pm    Post subject: Oke Reply with quote

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
View user's profile Visit poster's website
naseerak

Bascom Member



Joined: 08 Nov 2008
Posts: 138

pakistan.gif
PostPosted: Sun Sep 27, 2015 5:33 pm    Post subject: Reply with quote

ALL works fine now except the problem with portd.6 any idea?
Back to top
View user's profile
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Sun Sep 27, 2015 6:37 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum