Version 0 of Xilinx Spartan 3 Demo rs232 clock set

Updated 2005-05-11 09:43:32

TV

I've been working with a Xilinx Spartan 3 demo board, for which there is a clock example which can be burned in the config flash with little effort and that clock can be set (and som eother things) over 232 link.

This tcl script programs the computer clock automatically into the board with a readable command:

 #open serial port
 set fh [open COM1: RDWR]
 fconfigure $fh -blocking 0 -mode 9600,n,8,1 -translation binary -translation cr -buffering none

 # make a text window for incoming communication
 text .t -width 40 -height 10
 pack .t -expand y -fill both
 fileevent $fh readable {.t insert end [read $fh] ;.t see end}

 # print time, and set the xilinx time
 puts [clock format [clock seconds] -format "%H:%M:%S"]
 puts $fh "time" ; flush $fh
 puts $fh "time [clock format [clock seconds] -format \"%H:%M:%S\"]" ; flush $fh