View Full Version : 4094 Please Help
dovegroup
- 9th September 2009, 16:59
hello
I wrote this for the 16F877 for 2 4094
The first 4094 works correctly the second not
What I do wrong please help
thanks
INCLUDE "modedefs.bas"
TRISC = %00000000
symbol clock=portc.0
symbol data_pin=portc.1
symbol strb=PORTc.2
symbol data_pin2=portc.3
main:
high strb
high data_pin 'FOR STROBE HIGH
ShiftOut data_pin,clock,1,[%11000011]
low strb
low data_pin
high strb
high data_pin2
ShiftOut data_pin,clock,1,[%10000001]
low strb
low data_pin2
pause 2000
goto main
http://i279.photobucket.com/albums/kk141/sakisst/demo1.png
mackrackit
- 9th September 2009, 19:27
Maybe add this to your code?
ShiftOut data_pin2,clock,1,[%10000001]
:)
dovegroup
- 10th September 2009, 07:45
Hi mackrackit
Thank's for your thoughts
I tried ShiftOut data_pin2,clock,1,[%11000011] but not working properly U2
Ioannis
- 10th September 2009, 08:41
I would recomend seperate control pins for the second 4094 (OE and STRB) with common CLK.
Or even better, use the two 4094 in chain and feed data to the second Data in out of the first 4094, using common controls as you do now.
Ten you have to send 16bits of course, before activate outputs.
Ioannis
dovegroup
- 10th September 2009, 11:22
Hi Ioannis
You're right it works perfectly
View circuit and program to Picbasic
Thank you very much my friend Ioannis
INCLUDE "modedefs.bas"
DEFINE SHIFT_PAUSEUS 100
TRISC = %00000000
symbol clock=portc.0
symbol data_pin=portc.1
symbol strb1=PORTc.2
symbol strb2=PORTc.3
alarm var word
miso var byte
alarm = %1001100111010111
miso = alarm>>8
main:
high strb1
ShiftOut data_pin,clock,0,[alarm\8]
low strb1
high strb2
ShiftOut data_pin,clock,0,[miso]
low strb2
pause 2000
goto main
http://i279.photobucket.com/albums/kk141/sakisst/demo2.png
mehmetOzdemir
- 10th September 2009, 11:52
HI DOVEGROUP.
YOU DONT NEED TO USE EXTRA PINS FOR ANOTHER 4094.YOU CAN USE SAME PORTS.
YOU CAN CONNECT "Qs DATA OUT" TO ANOTHER 4094.
include "modedefs.bas"
ADCON1 = 7
STRB VAR PORTC.2
DAT VAR PORTC.1
CLK VAR PORTC.0
OUTPUT STRB
OUTPUT DAT
OUTPUT CLK
DATA_1 VAR BYTE
DATA_2 VAR BYTE
DATA_1 = %11000011
DATA_2 = %10000001
MAIN :
SHIFTOUT DAT , CLK , 1,[DATA_2 , DATA_1]
STRB = 1 : PAUSEUS 100 : STRB = 0
GOTO MAIN
Ioannis
- 10th September 2009, 12:11
Hmm, although I did proposed that too, dovegroup prefered to do the other way. May be it he needs seperate control over the second chip.
If there are free pins then it is OK I guess.
Ioannis
Powered by vBulletin® Version 4.1.7 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.