!!!!    6    0    1  719003982   0000                                         

!-----------------------------------------------------------------------
!  Copyright (c) Hewlett-Packard Co. 1992
!
!  All Rights Reserved.  Reproduction, adaptation, or translation
!  without prior written permission is prohibited, except as allowed
!  under the copyright laws.
!
!-----------------------------------------------------------------------
!
! Device:        93c66
! Manufacturer:  National/Excel
! Description:   4k Bit Serial EPROM
! Package:       8 pin DIL
! Test Platform: 3070
! Safeguard:     standard_cmos
!
!-----------------------------------------------------------------------
!
! Additional Comments:
!
!-----------------------------------------------------------------------

sequential

vector cycle  10u
receive delay 9.9u

assign   VCC                  to pins 8
assign   GND                  to pins 5

assign   Chip_select          to pins 1
assign   Clock_input          to pins 2
assign   Data_in              to pins 3
assign   Data_out             to pins 4
assign   No_connect           to pins 7
assign   Org                  to pins 6     default "1"

power          VCC,GND
family         TTL

nondigital     No_connect
inputs         Chip_select,Clock_input,Data_in,Org
outputs        Data_out

!*******************   Disable information        *****************

disable Data_out with Chip_select to "0"

!*******************   Backtrace information      *****************

when Chip_select is "0" inactive Data_out

trace Data_out to Chip_select,Clock_input,Data_in


set ref on pins 1,2,3 to dl 0,dh 4.5
set load on pins 4 to pull up

!*******************************************************************
!*******************      VECTOR SECTION       *********************
!*******************************************************************

vector  Initialize                  !Set device to a known state.
   set   Chip_select          to "0"
   set   Clock_input          to "0"
   set   Data_in              to "0"
end vector

vector  Keep                 !Save input values.
   set   ORG                  to "k"
   set   Chip_select          to "k"
   set   Clock_input          to "k"
   set   Data_in              to "k"
end vector

vector  ORG_high  ! 256*16
   initialize                 to Keep
   set   ORG                  to "1"
end vector

vector  ORG_low   ! 512*8
   initialize                 to Keep
   set   ORG                  to "0"
end vector

vector  Chip_select_high
   initialize                 to Keep
   set   Chip_select          to "1"
end vector

vector  Chip_select_low
   initialize                 to Keep
   set   Chip_select          to "0"
end vector

vector  Clock_high
   initialize                 to Keep
   set   Clock_input          to "0"
end vector

vector  Clock_low
   initialize                 to Keep
   set   Clock_input          to "1"
end vector

vector  Start_bit
   initialize                 to Keep
   set   Data_in              to "1"
end vector

vector  Data_in_0
   initialize                 to Keep
   set   Data_in              to "0"
end vector

vector  Data_in_1
   initialize                 to Keep
   set   Data_in              to "1"
end vector

vector  Data_out_0
   initialize                 to Keep
   set   Data_out             to "0"
end vector

vector  Data_out_1
   initialize                 to Keep
   set   Data_out             to "1"
end vector


!*******************************************************************
!*******************    SUBROUTINE SECTION     *********************
!*******************************************************************

sub  Write_instruction_A7_A0           !101 (A7 - A0) (D15 - D0)
   execute  Chip_select_high
   execute  Clock_low
   execute  Clock_high
   execute  Start_bit
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_1
   execute  Clock_low
   execute  Clock_high
end sub

sub  Erase_all_A7_A0           !100    10xxxxxx
   execute  Chip_select_high
   execute  Clock_low
   execute  Clock_high
   execute  Start_bit
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_1
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high
   repeat   6 times
      execute  Data_IN_0
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub


sub  Write_All_A7_A0  !101 01xxxxxx (D15 - D0)
   execute  Chip_select_high
   execute  Clock_low
   execute  Clock_high
   execute  Start_bit
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_1
   execute  Clock_low
   execute  Clock_high
   repeat   6 times
      execute  Data_IN_0
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub


sub  Read_instruction_A7_A0             !110 (A7 - A0)
   execute  Chip_select_high
   execute  Clock_low
   execute  Clock_high
   execute  Start_bit
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_1
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high
end sub

sub  Erase_instruction_A7_A0            !111 (A7 - A0)
   execute  Chip_select_high
   execute  Clock_low
   execute  Clock_high
   execute  Start_bit
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_1
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_1
   execute  Clock_low
   execute  Clock_high
end sub

sub  Enable_instruction_A7_A0           !100  11xxxxxx
   execute  Data_in_0
   execute  Chip_select_high

   execute  Clock_low
   execute  Clock_high

   execute  Start_bit
   execute  Clock_low
   execute  Clock_high

   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high

   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high

   execute  Data_in_1
   execute  Clock_low
   execute  Clock_high

   execute  Data_in_1
   execute  Clock_low
   execute  Clock_high

   repeat   6 times
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
   end repeat

   execute  Data_In_0
   execute  Chip_select_low

   repeat   10 times
      execute  Clock_low
      execute  Clock_high
   end repeat

   execute  Chip_select_high
   repeat   500 times
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub


sub  Write_Address_A7_A0_55

   repeat   4 times
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub


sub  Write_Address_A7_A0_AA

   repeat   4 times
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub


sub  Write_Data_D15_D0_0000

   repeat   8 times
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub


sub  Write_Data_D15_D0_5555

   repeat   8 times
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub


sub  Write_Data_D15_D0_AAAA

   repeat   8 times
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub

sub  Read_Address_A7_A0_55

   repeat   4 times
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub


sub  Read_Address_A7_A0_AA

   repeat   4 times
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub


sub  Read_Data_D15_D0_0000

   repeat   8 times
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub

sub  Read_Data_D15_D0_5555

   repeat   8 times
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub

sub  Read_Data_D15_D0_AAAA

   repeat   8 times
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
   end repeat
end sub

sub  Read_Data_D15_D0_FFFF
   repeat   16 times
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
   end repeat
end sub

!******************************************************
!Subs for Memory Organization 512 * 8
!******************************************************

sub  Write_instruction_A8_A0           !101 (A8 - A0) (D7 - D0)
   execute  Chip_select_high
   execute  Clock_low
   execute  Clock_high
   execute  Start_bit
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_1
   execute  Clock_low
   execute  Clock_high
end sub

sub  Erase_all_A8_A0           !100    10xxxxxxx
   execute  Chip_select_high
   execute  Clock_low
   execute  Clock_high
   execute  Start_bit
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_1
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high
   repeat   7 times
      execute  Data_IN_0
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub


sub  Write_All_A8_A0  !101 01xxxxxxx (D7 - D0)
   execute  Chip_select_high
   execute  Clock_low
   execute  Clock_high
   execute  Start_bit
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_1
   execute  Clock_low
   execute  Clock_high
   repeat   7 times
      execute  Data_IN_0
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub


sub  Read_instruction_A8_A0             !110 (A8 - A0)
   execute  Chip_select_high
   execute  Clock_low
   execute  Clock_high
   execute  Start_bit
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_1
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high
end sub

sub  Erase_instruction_A8_A0            !111 (A8 - A0)
   execute  Chip_select_high
   execute  Clock_low
   execute  Clock_high
   execute  Start_bit
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_1
   execute  Clock_low
   execute  Clock_high
   execute  Data_in_1
   execute  Clock_low
   execute  Clock_high
end sub

sub  Enable_instruction_A8_A0           !100  11xxxxxxx
   execute  Data_in_0
   execute  Chip_select_high

   execute  Clock_low
   execute  Clock_high

   execute  Start_bit
   execute  Clock_low
   execute  Clock_high

   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high

   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high

   execute  Data_in_1
   execute  Clock_low
   execute  Clock_high

   execute  Data_in_1
   execute  Clock_low
   execute  Clock_high

   repeat   7 times
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
   end repeat

   execute  Data_In_0
   execute  Chip_select_low

   repeat   10 times
      execute  Clock_low
      execute  Clock_high
   end repeat

   execute  Chip_select_high
   repeat   500 times
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub


sub  Write_Address_A8_A0_550

   repeat   4 times
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
   end repeat

   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high


end sub


sub  Write_Address_A8_A0_AA1

   repeat   4 times
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
   end repeat

   execute  Data_in_1
   execute  Clock_low
   execute  Clock_high

end sub


sub  Write_Data_D7_D0_00

   repeat   4 times
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub


sub  Write_Data_D7_D0_55

   repeat   4 times
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub


sub  Write_Data_D7_D0_AA

   repeat   4 times
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub

sub  Read_Address_A8_A0_550

   repeat   4 times
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
   end repeat
   execute  Data_in_0
   execute  Clock_low
   execute  Clock_high

end sub


sub  Read_Address_A8_A0_AA1

   repeat   4 times
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
   end repeat
   execute  Data_in_1
   execute  Clock_low
   execute  Clock_high

end sub


sub  Read_Data_D7_D0_00

   repeat   4 times
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub

sub  Read_Data_D7_D0_55

   repeat   4 times
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
   end repeat

end sub

sub  Read_Data_D7_D0_AA

   repeat   4 times
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
      execute  Data_in_0
      execute  Clock_low
      execute  Clock_high
   end repeat
end sub

sub  Read_Data_D7_D0_FF
   repeat   8 times
      execute  Data_in_1
      execute  Clock_low
      execute  Clock_high
   end repeat
end sub




sub  Wait_for_Ready           !Subroutine to ends the WRITE Sequence
   repeat   1 times
      execute  Data_In_0
      execute  Chip_select_low

      execute  Clock_low
      execute  Clock_high

      execute  Chip_select_high

!-------------------------------------------
! wait for BUSY status :
!-------------------------------------------
      execute  Data_Out_0

!-------------------------------------------
! wait for READY status :
!-------------------------------------------
      homingloop  25000 times
         execute  Data_out_1 exit if pass
         execute  Clock_high
         execute  Clock_low
      end homingloop
   end repeat
end sub


!*******************************************************************
!*********************      UNIT SECTION       *********************
!*******************************************************************

!-------------------------------------------------------------------------------
! The following units are for ORGANIZATION 256*16 (ORG High) :
!-------------------------------------------------------------------------------

!------------------------------------------------------------------
unit  "Enable the chip / 256*16"
!This unit must be run first as it enables the device
!and allows it to be written to.
!-----------------------------------------------------------------
   execute  Initialize
   execute  ORG_High

   repeat   500 times
      execute  Clock_high
      execute  Clock_low
   end repeat

   call  Enable_instruction_A7_A0

   repeat   500 times
      execute  Clock_high
      execute  Clock_low
   end repeat

end unit



!--------------------------------------------------------------------
unit  "Chip Test"  !Write and read the chip in different forms
!--------------------------------------------------------------------
!--------------------------------
   call  Erase_all_A7_A0
!--------------------------------


   call  Wait_for_Ready

!--------------------------------
   call  Write_All_A7_A0
!--------------------------------



   call  Write_Data_D15_D0_AAAA

   call  Wait_for_Ready

!--------------------------------------
! READ ADDRESS AA,Data AAAA
!--------------------------------------
   call  Read_instruction_A7_A0         !Read from address.

   call  Read_Address_A7_A0_AA

   execute  Data_out_0            !one logical "0" bit precedes data
   execute  Clock_low
   execute  Clock_high

   call  Read_Data_D15_D0_AAAA

   execute  Chip_Select_low

   execute  Clock_low
   execute  Clock_high

   execute  Chip_Select_high
   repeat   500 times
      execute  Clock_high
      execute  Clock_low
   end repeat
!------------------------------------------
! END READ CYCLE
!------------------------------------------

!--------------------------------
   call  Erase_all_A7_A0
!--------------------------------

   call  Wait_for_Ready

!--------------------------------
   call  Write_All_A7_A0
!--------------------------------


   call  Write_Data_D15_D0_5555

   call  Wait_for_Ready

   !--------------------------------------
   ! READ ADDRESS 55,Data 5555
   !--------------------------------------
   call  Read_instruction_A7_A0         !Read from address.

   call  Read_Address_A7_A0_55

   execute  Data_out_0            !one logical "0" bit precedes data
   execute  Clock_low
   execute  Clock_high

   call  Read_Data_D15_D0_5555

   execute  Chip_Select_low
   execute  Clock_low
   execute  Clock_high
   execute  Chip_Select_high
   repeat   500 times
      execute  Clock_high
      execute  Clock_low
   end repeat


!------------------------------------------
! END READ CYCLE
!------------------------------------------

!--------------------------------
   call  Write_instruction_A7_A0
!--------------------------------

   call  Write_Address_A7_A0_AA

   call  Write_Data_D15_D0_AAAA

   call  Wait_for_Ready


!--------------------------------------
! READ ADDRESS AA, Data AAAA
!--------------------------------------
   call  Read_instruction_A7_A0         !Read from address.AAh

   call  Read_Address_A7_A0_AA

   execute  Data_out_0             !one logical "0" bit precedes data
   execute  Clock_low
   execute  Clock_high

   call  Read_Data_D15_D0_AAAA

   execute  Chip_Select_low
   execute  Clock_low
   execute  Clock_high
   execute  Chip_Select_high
   repeat   500 times
      execute  Clock_high
      execute  Clock_low
   end repeat
!------------------------------------------
! END READ CYCLE
!------------------------------------------

!--------------------------------
   call  Write_instruction_A7_A0
!--------------------------------

   call  Write_Address_A7_A0_55

   call  Write_Data_D15_D0_5555
   call  Wait_for_Ready


!--------------------------------------
! READ ADDRESS 55h, Data 5555h
!--------------------------------------
   call  Read_instruction_A7_A0         !Read from address. 55h

   call  Read_Address_A7_A0_55

   execute  Data_out_0            !one logical "0" bit precedes data
   execute  Clock_low
   execute  Clock_high

   call  Read_Data_D15_D0_5555

   execute  Chip_Select_low
   execute  Clock_low
   execute  Clock_high
   execute  Chip_Select_high
   repeat   500 times
      execute  Clock_high
      execute  Clock_low
   end repeat
!------------------------------------------
! END READ CYCLE
!------------------------------------------


end unit



!-------------------------------------------
unit  "Erase_Address"
!-------------------------------------------
! ERASE ADDRESS AAh => Data FFFFh
!-------------------------------------------

   call  Erase_instruction_A7_A0        !Erase OPcode.

   call  Write_Address_A7_A0_AA


   call  Wait_for_Ready

!--------------------------------------
! READ ADDRESS AA , Data 1111
!--------------------------------------
   call  Read_instruction_A7_A0         !Read from address.

   call  Read_Address_A7_A0_AA

   execute  Data_out_0          !one logical "0" bit precedes data
   execute  Clock_low
   execute  Clock_high

   call  Read_Data_D15_D0_FFFF

   execute  Chip_Select_low
   execute  Clock_low
   execute  Clock_high
   execute  Chip_Select_high
   repeat   500 times
      execute  Clock_high
      execute  Clock_low
   end repeat

!------------------------------------------
! END READ CYCLE
!------------------------------------------
end unit


!---------------------------------------------------
unit  "Check for High-Z state of Data_out pin"
!----------------------------------------------------
   call  Write_instruction_A7_A0
!--------------------------------------------

   call  Write_Address_A7_A0_55

   call  Write_Data_D15_D0_0000

   call  Wait_for_Ready


!---------------------------------------------
! READ ADDRESS 55h, Data FFFFh, while 3-state
!---------------------------------------------
   call  Read_instruction_A7_A0         !Read from address.

   call  Read_Address_A7_A0_55

   execute  Data_out_0            !one logical "0" bit precedes data
   execute  Clock_low
   execute  Clock_high


   execute  Chip_Select_low     !Result is 3-State on Output

   call  Read_Data_D15_D0_FFFF     !Data, D15-D0(FFFFh) while 3-State

   execute  Chip_Select_low
   execute  Clock_low
   execute  Clock_high
   execute  Chip_Select_high

   repeat   500 times
      execute  Clock_high
      execute  Clock_low
   end repeat
!------------------------------------------
! END READ CYCLE
!------------------------------------------
end unit


!This Part is for a Chip with two Memory Organizations 256*16 and 512*8


!-------------------------------------------------------------------------------
! The following units are for ORGANIZATION 512*8 (ORG low) :
!-------------------------------------------------------------------------------

!------------------------------------------------------------------
!93c66 unit "Enable the chip / 512*8"
!This !93c66 unit must be run first as it enables the device
!and allows it to be written to.
!-----------------------------------------------------------------
 !93c66 execute Initialize
 !93c66 execute ORG_low

  !93c66 repeat 500 times
     !93c66 execute Clock_high
     !93c66 execute Clock_low
  !93c66 end !93c66 repeat

!93c66 call Enable_instruction_A8_A0

  !93c66 repeat 500 times
     !93c66 execute Clock_high
     !93c66 execute Clock_low
  !93c66 end !93c66 repeat

!93c66 end !93c66 unit



!--------------------------------------------------------------------
!93c66 unit "Chip Test"  !Write and read the chip in different forms
!--------------------------------------------------------------------
!--------------------------------
!93c66 call Erase_all_A8_A0
!--------------------------------


   !93c66 call Wait_for_Ready

!--------------------------------
!93c66 call Write_All_A8_A0
!--------------------------------



   !93c66 call Write_Data_D7_D0_AA

   !93c66 call Wait_for_Ready

!--------------------------------------
! READ ADDRESS AA1,Data AA
!--------------------------------------
   !93c66 call Read_instruction_A8_A0         !Read from address.

   !93c66 call Read_Address_A8_A0_AA1

   !93c66 execute Data_out_0            !one logical "0" bit precedes data
   !93c66 execute Clock_low
   !93c66 execute Clock_high

   !93c66 call Read_Data_D7_D0_AA

   !93c66 execute Chip_Select_low

   !93c66 execute Clock_low
   !93c66 execute Clock_high

   !93c66 execute Chip_Select_high
  !93c66 repeat 500 times
     !93c66 execute Clock_high
     !93c66 execute Clock_low
  !93c66 end !93c66 repeat
!------------------------------------------
! !93c66 end READ CYCLE
!------------------------------------------

!--------------------------------
!93c66 call Erase_all_A8_A0
!--------------------------------

   !93c66 call Wait_for_Ready

!--------------------------------
!93c66 call Write_All_A8_A0
!--------------------------------


   !93c66 call Write_Data_D7_D0_55

   !93c66 call Wait_for_Ready

   !--------------------------------------
   ! READ ADDRESS 550,Data 55
   !--------------------------------------
   !93c66 call Read_instruction_A8_A0         !Read from address.

   !93c66 call Read_Address_A8_A0_550

   !93c66 execute Data_out_0            !one logical "0" bit precedes data
   !93c66 execute Clock_low
   !93c66 execute Clock_high

   !93c66 call Read_Data_D7_D0_55

   !93c66 execute Chip_Select_low
   !93c66 execute Clock_low
   !93c66 execute Clock_high
   !93c66 execute Chip_Select_high
  !93c66 repeat 500 times
     !93c66 execute Clock_high
     !93c66 execute Clock_low
  !93c66 end !93c66 repeat


!------------------------------------------
! !93c66 end READ CYCLE
!------------------------------------------

!--------------------------------
!93c66 call Write_instruction_A8_A0
!--------------------------------

   !93c66 call Write_Address_A8_A0_AA1

   !93c66 call Write_Data_D7_D0_AA

   !93c66 call Wait_for_Ready


!--------------------------------------
! READ ADDRESS AA1, Data AA
!--------------------------------------
   !93c66 call Read_instruction_A8_A0         !Read from address.AAh

   !93c66 call Read_Address_A8_A0_AA1

   !93c66 execute Data_out_0             !one logical "0" bit precedes data
   !93c66 execute Clock_low
   !93c66 execute Clock_high

   !93c66 call Read_Data_D7_D0_AA

   !93c66 execute Chip_Select_low
   !93c66 execute Clock_low
   !93c66 execute Clock_high
   !93c66 execute Chip_Select_high
  !93c66 repeat 500 times
     !93c66 execute Clock_high
     !93c66 execute Clock_low
  !93c66 end !93c66 repeat
!------------------------------------------
! !93c66 end READ CYCLE
!------------------------------------------

!--------------------------------
!93c66 call Write_instruction_A8_A0
!--------------------------------

    !93c66 call Write_Address_A8_A0_550

   !93c66 call Write_Data_D7_D0_55
   !93c66 call Wait_for_Ready


!--------------------------------------
! READ ADDRESS 550h, Data 55h
!--------------------------------------
   !93c66 call Read_instruction_A8_A0         !Read from address. 55h

   !93c66 call Read_Address_A8_A0_550

   !93c66 execute Data_out_0            !one logical "0" bit precedes data
   !93c66 execute Clock_low
   !93c66 execute Clock_high

   !93c66 call Read_Data_D7_D0_55

   !93c66 execute Chip_Select_low
   !93c66 execute Clock_low
   !93c66 execute Clock_high
   !93c66 execute Chip_Select_high
  !93c66 repeat 500 times
     !93c66 execute Clock_high
     !93c66 execute Clock_low
  !93c66 end !93c66 repeat
!------------------------------------------
! !93c66 end READ CYCLE
!------------------------------------------


!93c66 end !93c66 unit



!-------------------------------------------
!93c66 unit "Erase_Address"
!-------------------------------------------
! ERASE ADDRESS AA1h => Data FFh
!-------------------------------------------

!93c66 call Erase_instruction_A8_A0        !Erase OPcode.

   !93c66 call Write_Address_A8_A0_AA1


   !93c66 call Wait_for_Ready

!--------------------------------------
! READ ADDRESS AA1 , Data 11
!--------------------------------------
 !93c66 call Read_instruction_A8_A0         !Read from address.

 !93c66 call Read_Address_A8_A0_AA1

   !93c66 execute Data_out_0          !one logical "0" bit precedes data
   !93c66 execute Clock_low
   !93c66 execute Clock_high

   !93c66 call Read_Data_D7_D0_FF

   !93c66 execute Chip_Select_low
   !93c66 execute Clock_low
   !93c66 execute Clock_high
   !93c66 execute Chip_Select_high
  !93c66 repeat 500 times
     !93c66 execute Clock_high
     !93c66 execute Clock_low
  !93c66 end !93c66 repeat

!------------------------------------------
! !93c66 end READ CYCLE
!------------------------------------------
!93c66 end !93c66 unit


!---------------------------------------------------
!unit"Check for High-Z state of Data_out pin"
!----------------------------------------------------
!93c66 call Write_instruction_A8_A0
!--------------------------------------------

 !93c66 call Write_Address_A8_A0_550

   !93c66 call Write_Data_D7_D0_00

   !93c66 call Wait_for_Ready


!---------------------------------------------
! READ ADDRESS 550h, Data FFh, while 3-state
!---------------------------------------------
   !93c66 call Read_instruction_A8_A0         !Read from address.

   !93c66 call Read_Address_A8_A0_550

   !93c66 execute Data_out_0            !one logical "0" bit precedes data
   !93c66 execute Clock_low
   !93c66 execute Clock_high


   !93c66 execute Chip_Select_low     !Result is 3-State on Output

   !93c66 call Read_Data_D7_D0_FF     !Data, D15-D0(FFFFh) while 3-State

   !93c66 execute Chip_Select_low
   !93c66 execute Clock_low
   !93c66 execute Clock_high
   !93c66 execute Chip_Select_high

  !93c66 repeat 500 times
     !93c66 execute Clock_high
     !93c66 execute Clock_low
  !93c66 end !93c66 repeat
!------------------------------------------
! !93c66 end READ CYCLE
!------------------------------------------
!93c66 end !93c66 unit


! COMMENT :
! changem "end " to "!93c66 end "
! changem "sub " to "!93c66 sub "
! changem "unit " to "!93c66 unit "
! changem "call " to "!93c66 call "
! changem "execute " to "!93c66 execute "
! changem "repeat " to "!93c66 repeat "
! changem "homingloop " to "!93c66 homingloop "
! changem "delay " to "!93c66 delay "
! changem "preset " to "!93c66 preset "
! changem "count " to "!93c66 count "

! UNCOMMENT :
! changem "!93c66 sub " to "sub "
! changem "!93c66 unit " to "unit "
! changem "!93c66 call " to "call "
! changem "!93c66 execute " to "execute "
! changem "!93c66 repeat " to "repeat "
! changem "!93c66 homingloop " to "homingloop  "
! changem "!93c66 delay " to "delay "
! changem "!93c66 end " to "end "
! changem "!93c66 preset " to "preset "
! changem "!93c66 count " to "count "

!
!  End of test
!
