!!!!    6    0    1  617920881                                                


!      93C46
!      1K bit serial CMOS EEPROM
!      revision A.02.00

!SGS-Thomson Microelectronics Spec. Sheet

!safeguard is "high_out_cmos"

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 Organization_input   to pins 6
assign Data_in              to pins 3

assign Data_out             to pins 4

assign No_connect           to pins 7

power          VCC,GND
family         TTL

nondigital     No_connect
inputs         Chip_select,Clock_input
inputs         Organization_input,Data_in
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,Organization_input,Data_in


!warning "Pull-up required on Data_out (pin 4) for entire test to run."

set load on groups  Data_out  to pull up

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

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

vector Keep_values                 !Save input values.
   set Chip_select          to "k"
   set Clock_input          to "k"
   set Organization_input   to "k"
   set Data_in              to "k"
end vector

vector ORG_low
   initialize to Keep_values
   set Organization_input   to "0"
end vector

vector ORG_high
   initialize to Keep_values
   set Organization_input   to "1"
end vector

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

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

vector Clock
   initialize to Keep_values
   set Clock_input          to "t"
end vector

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

vector Data_in_X
   initialize to Keep_values
   set Data_in               to "x"
end vector

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

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

vector Data_out_x
   initialize to Keep_values
   set Data_out              to "x"
end vector

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

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


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

sub Write_instruction            !Subroutine to begin the write sequence.
   execute Chip_select_high
   execute Clock
   execute Clock
   execute Start_bit
   execute Clock
   execute Clock
   execute Data_in_0
   execute Clock
   execute Clock
   execute Data_in_1
   execute Clock
   execute Clock
end sub

sub Read_instruction             !Subroutine to begin the read sequence.
   execute Chip_select_high
   execute Clock
   execute Clock
   execute Start_bit
   execute Clock
   execute Clock
   execute Data_in_1
   execute Clock
   execute Clock
   execute Data_in_0
   execute Clock
   execute Clock
end sub

sub Erase_instruction            !Subroutine to begin the erase sequence.
   execute Chip_select_high
   execute Clock
   execute Clock
   execute Start_bit
   execute Clock
   execute Clock
   repeat 2 times
      execute Data_in_1
      execute Clock
      execute Clock
   end repeat
end sub

sub Enable_instruction           !Subroutine to begin the chip enable
   execute Chip_select_high      !sequence.
   execute Clock
   execute Clock
   execute Start_bit
   execute Clock
   execute Clock
   execute Data_in_0
   execute Clock
   execute Clock
   execute Data_in_0
   execute Clock
   execute Clock
   end sub

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

!This unit must be run first as it enables the device
!and allows it to be written to.

unit "Enable the chip"
   execute Set_values
   repeat 50 times
      execute Clock
      execute Clock
   end repeat

   call Enable_instruction
   repeat 2 times
      execute Data_in_1
      execute Clock
      execute Clock
   end repeat
   repeat 5 times
      execute Data_in_X
      execute Clock
      execute Clock
   end repeat
   execute Chip_select_high
   repeat 160 times
      execute Clock
      execute Clock
   end repeat
   execute Chip_select_low
   repeat 280 times
      execute Clock
      execute Clock
   end repeat

end unit

unit "Test EEPROM"
   execute Set_values
   execute ORG_high              !Set memory size
   call Write_instruction        !Write to device.
   repeat 6 times                !Address=111111
      execute Data_in_1
      execute Clock
      execute Clock
   end repeat
   repeat 16 times               !Data, D15-D0(0000h)
      execute Data_in_0
      execute Clock
      execute Clock
   end repeat
   execute Chip_select_low       !Allow for timed write sequence.
      repeat 100 times
      execute Clock
      execute Clock
   end repeat

   execute ORG_high              !Set memory size.
   call Read_instruction         !Read from address.
   repeat 6 times                !Address=111111
      execute Data_in_1
      execute Clock
      execute Clock
   end repeat
   homingloop 20 times           !Check for 'dummy bit'.
      execute Data_out_0     exit if pass
      execute Clock
      execute Clock
   end homingloop
   execute Clock
   execute Clock
   repeat 16 times               !Data, D15-D0(0000h)
      execute Data_out_0
      execute Clock
      execute Clock
   end repeat


   execute Set_values            !Memory size is set.
   call Write_instruction        !Write to device.
   repeat 7 times                !Address=0000000
      execute Data_in_0
      execute Clock
      execute Clock
   end repeat
   repeat 8 times                !Data, D7-D0(FFh)
      execute Data_in_1
      execute Clock
      execute Clock
   end repeat
   execute Chip_select_low       !Allow time for timed write sequence.
   repeat 150 times
      execute Clock
      execute Clock
   end repeat

   call Read_instruction         !start Read
   repeat 7 times                !Address=0000000
      execute Data_in_0
      execute Clock
      execute Clock
   end repeat
   homingloop 10 times           !Check for 'dummy bit'.
      execute Clock
      execute Data_out_0             exit if pass
      execute Clock
   end homingloop
   homingloop 40 times           !Check for valid data.
      execute Clock
      execute Clock
      execute Data_out_1           exit if pass
   end homingloop
   repeat 7 times
      execute Data_out_1
      execute Clock
      execute Clock
   end repeat

   execute Set_values
   execute ORG_high              !Set memory size
   call Erase_instruction        !Erase OPcode.
   repeat 6 times                !Address=111111
      execute Data_in_1
      execute Clock
      execute Clock
   end repeat
   execute Chip_select_low       !Allow for timed erase sequence.
   repeat 100 times
      execute Clock
      execute Clock
   end repeat

   execute Set_values
   execute ORG_high
   call Read_instruction
   repeat 6 times                !Address=111111
      execute Data_in_1
      execute Clock
      execute Clock
   end repeat
   homingloop 10 times           !Check for 'dummy bit'.
      execute Data_out_0          exit if pass
      execute Clock
      execute Clock
   end homingloop
   homingloop 90 times           !Check for the start of valid data.
      execute Clock
      execute Clock
      execute Data_out_1         exit if pass
   end homingloop
   repeat 15 times               !Data, D15-D0(FFFFh),when the address is
      execute Clock              !erased.
      execute Clock
      execute Data_out_1
   end repeat

end unit

unit "Test Memory Array Input pin"
   execute Set_values
   execute ORG_high              !Set memory array size.
   call Write_instruction        !Write to address.
   repeat 6 times                !Address = 000000
      execute Data_in_0
      execute Clock
      execute Clock
   end repeat
   repeat 16 times               !Data = 0000h
      execute Data_in_0
      execute Clock
      execute Clock
   end repeat
   execute Chip_select_low
   repeat 200 times              !Allow for timed write sequence.
       execute Clock
       execute Clock
   end repeat

   execute ORG_low               !Set new memory array size.
   call Write_instruction        !Write to address.
   repeat 7 times                !Address = 0000000
      execute Data_in_0
      execute Clock
      execute Clock
   end repeat
   repeat 8 times                !Data = 11111111(FFh)
      execute Data_in_1
      execute Clock
      execute Clock
   end repeat

   execute Chip_select_low       !Allow time for write sequence.
   repeat 200 times
      execute Clock
      execute Clock
   end repeat

   execute ORG_high              !New memory array size.
   call Read_instruction         !Read Address = 000000
   repeat 6 times
      execute Data_in_0
      execute Clock
      execute Clock
   end repeat
   homingloop 20 times           !Check 'dummy bit'.
      execute Data_out_0     exit if pass
      execute Clock
      execute Clock
   end homingloop
   repeat 16 times               !Data = 0000h
      execute Clock
      execute Clock
      execute Data_out_0
   end repeat

   execute ORG_low               !New memory array size.
   call Read_instruction         !Read Address = 0000000
   repeat 7 times
      execute Data_in_0
      execute Clock
      execute Clock
   end repeat
   homingloop 10 times           !Check for 'dummy bit'.
      execute Clock
      execute Data_out_0   exit if pass
      execute Clock
   end homingloop
   homingloop 90 times           !Check for start of valid data.
     execute Clock
      execute Clock
      execute Data_out_1           exit if pass
   end homingloop
   repeat 7 times                !Data = FFh
      execute Data_out_1
      execute Clock
      execute Clock
   end repeat

end unit

unit"Check for High-Z state of Data_out pin"
   execute Set_values
   execute ORG_high              !Set memory size
   call Write_instruction        !Write to device.
   repeat 6 times                !Address=111111
      execute Data_in_1
      execute Clock
      execute Clock
   end repeat
   repeat 16 times               !Data, D15-D0(0000h)
      execute Data_in_0
      execute Clock
      execute Clock
   end repeat
   execute Chip_select_low       !Allow for timed write sequence.
      repeat 200 times
      execute Clock
      execute Clock
   end repeat

   call Read_instruction         !Read address.
   repeat 6 times                !Address=111111
      execute Data_in_1
      execute Clock
      execute Clock
   end repeat
   homingloop 10 times           !Check for 'dummy bit'.
      execute Data_out_0             exit if pass
      execute Clock
      execute Clock
   end homingloop
   execute Chip_select_low       !Disable chip.
   repeat 16 times               !Data, D15-D0(FFFFh); High impedance.
      execute Data_out_1
      execute Clock
      execute Clock
   end repeat

end unit

!
! End of test
!


