PDA

View Full Version : 74hc595 !!



uludere72
- 3rd June 2005, 11:55
I want to use 74HC595 shift register .
I wote simple test code for it . it seems ok .. but with proteus simulation doesnt shows anything .
where am i doing mistake!!

here is my code..


Include "modedefs.bas"
DEFINE SHIFT_PAUSEUS 1000
TxData var byte

symbol HC_Data = PORTA.0
SYMBOL HC_Clk = PORTA.1
Symbol HC_latch= PORTA.2
'symbol HC_Load = PORTA.3


TRISA = 0
PORTA = 0

Main:

TxData = $F0
gosub Send_Data

pause 1500

TxData = $0F

Gosub Send_Data

pause 1500

goto main
end

Send_Data :

'
shiftout HC_data, HC_Clk, MSBFIRST, [TxData]

HC_Latch=1
pauseus 5

HC_Latch=0
return

Bruce
- 3rd June 2005, 16:31
Set porta to digital by turning off A/D.

uludere72
- 6th June 2005, 07:53
thx.

i solved my problem by changing porta to portb :-)