Some VB software parts (not complete):
Private Sub device_program_enable()
'Program enable sequence
DataWrite_Enable (True) ' enable 574 on Board
P32_CS_Signal (False) ' P3.2 CS to low
datasend (&HAA) ' send preamble
datasend (&HAC) ' send opcode
datasend (&H53) ' send AdressHigh to enable
P32_CS_Signal (True) ' P3.2 CS to high
DataWrite_Enable (False) ' tristate 574 on Board
End Sub
Private Sub datasend(data As Byte)
' send datas to micro, clocks 574 and clocks P_SelectIn
Out PortAddress, data ' send preamble
cr_strobe (cr_DataStrobe) ' P strobe for latch to 572
cr_strobe (cr_clkstrobe) ' SelectIn: strobe for 2052/4052 XTAL1
End Sub
Public Sub P32_CS_Signal(stat As Boolean)
' true means that signal on Board is high (= VCC =deactivated)
HC_Reg = HC_Reg Xor 2 ^ P32_CS ' toggle CS signal
Out PortAddress, HC_Reg ' Daten anlegen
cr_strobe (cr_InitStrobe) ' init strobe for 74HC273 Bit 0
End Sub
欢迎光临 DIY编程器网 (http://diybcq.com./) | Powered by Discuz! X3.2 |