📄 control.rmh
字号:
/* Symbol Table */// ASCII_byte_to_hex = LABEL: 507// ASCII_letter = LABEL: 530// ASCII_to_hex = LABEL: 520// DS2432_menu = LABEL: 32// DS2432_prompt = LABEL: 34// DS_init_regular_mode = LABEL: 326// DS_wire = CONSTANT: 1// DS_wire_in_port = CONSTANT: 2// DS_wire_init = LABEL: 323// DS_wire_out_port = CONSTANT: 8// ISR = LABEL: 1022// ROM_menu = LABEL: 19// ROM_prompt = LABEL: 21// UART_data = REGISTER: 15// UART_read_port = CONSTANT: 1// UART_write = LABEL: 444// UART_write_port = CONSTANT: 4// character_0 = CONSTANT: 48// character_1 = CONSTANT: 49// character_2 = CONSTANT: 50// character_3 = CONSTANT: 51// character_4 = CONSTANT: 52// character_5 = CONSTANT: 53// character_6 = CONSTANT: 54// character_7 = CONSTANT: 55// character_8 = CONSTANT: 56// character_9 = CONSTANT: 57// character_A = CONSTANT: 65// character_B = CONSTANT: 66// character_BS = CONSTANT: 8// character_C = CONSTANT: 67// character_CR = CONSTANT: 13// character_D = CONSTANT: 68// character_E = CONSTANT: 69// character_F = CONSTANT: 70// character_G = CONSTANT: 71// character_H = CONSTANT: 72// character_I = CONSTANT: 73// character_J = CONSTANT: 74// character_K = CONSTANT: 75// character_L = CONSTANT: 76// character_LF = CONSTANT: 10// character_M = CONSTANT: 77// character_N = CONSTANT: 78// character_O = CONSTANT: 79// character_P = CONSTANT: 80// character_Q = CONSTANT: 81// character_R = CONSTANT: 82// character_S = CONSTANT: 83// character_T = CONSTANT: 84// character_U = CONSTANT: 85// character_V = CONSTANT: 86// character_W = CONSTANT: 87// character_X = CONSTANT: 88// character_XOFF = CONSTANT: 19// character_XON = CONSTANT: 17// character_Y = CONSTANT: 89// character_Z = CONSTANT: 90// character_a = CONSTANT: 97// character_b = CONSTANT: 98// character_c = CONSTANT: 99// character_close = CONSTANT: 41// character_colon = CONSTANT: 58// character_comma = CONSTANT: 44// character_d = CONSTANT: 100// character_divide = CONSTANT: 47// character_dollar = CONSTANT: 36// character_e = CONSTANT: 101// character_equals = CONSTANT: 61// character_exclaim = CONSTANT: 33// character_f = CONSTANT: 102// character_fullstop = CONSTANT: 46// character_g = CONSTANT: 103// character_greater_than = CONSTANT: 62// character_h = CONSTANT: 104// character_i = CONSTANT: 105// character_j = CONSTANT: 106// character_k = CONSTANT: 107// character_l = CONSTANT: 108// character_less_than = CONSTANT: 60// character_m = CONSTANT: 109// character_minus = CONSTANT: 45// character_n = CONSTANT: 110// character_o = CONSTANT: 111// character_open = CONSTANT: 40// character_p = CONSTANT: 112// character_plus = CONSTANT: 43// character_q = CONSTANT: 113// character_question = CONSTANT: 63// character_r = CONSTANT: 114// character_s = CONSTANT: 115// character_semi_colon = CONSTANT: 59// character_space = CONSTANT: 32// character_t = CONSTANT: 116// character_u = CONSTANT: 117// character_v = CONSTANT: 118// character_w = CONSTANT: 119// character_x = CONSTANT: 120// character_y = CONSTANT: 121// character_z = CONSTANT: 122// cold_start = LABEL: 0// command_start = CONSTANT: 8// compute_CRC16 = LABEL: 300// compute_CRC8 = LABEL: 274// crc16_bit_loop = LABEL: 305// crc16_byte_loop = LABEL: 303// crc16_shift = LABEL: 311// crc8_fail = LABEL: 96// crc8_loop = LABEL: 283// crc8_shift = LABEL: 288// decimal_to_ASCII = LABEL: 446// delay_1ms = LABEL: 419// delay_1s = LABEL: 429// delay_1us = LABEL: 410// delay_1us_constant = CONSTANT: 11// delay_20ms = LABEL: 424// delay_40us = LABEL: 414// disp_serial_loop = LABEL: 79// display_ROM = LABEL: 72// end_serial = LABEL: 85// end_write_scratchpad = LABEL: 194// family_code = CONSTANT: 0// hex_byte_to_ASCII = LABEL: 477// hex_to_ASCII = LABEL: 489// master_reset_regular = LABEL: 12// menu_prompt = LABEL: 51// next_slow_bit = LABEL: 359// no_valid_input = LABEL: 57// number_char = LABEL: 492// obtain_8bits = LABEL: 537// onechar_to_value = LABEL: 459// rbs_loop = LABEL: 387// rbs_wait_4us = LABEL: 394// rbs_wait_68us = LABEL: 406// rbs_wait_8us = LABEL: 400// read_DS_wire = LABEL: 349// read_ROM_CRC = CONSTANT: 7// read_ROM_command = LABEL: 63// read_ROM_loop = LABEL: 66// read_bit_slow = LABEL: 391// read_byte_command = LABEL: 204// read_byte_slow = LABEL: 386// read_character = LABEL: 438// read_from_UART = LABEL: 434// read_memory_command = LABEL: 102// read_scratchpad_command = LABEL: 212// read_upper_case = LABEL: 532// reset_menu = LABEL: 3// reset_passed = LABEL: 17// reset_prompt = LABEL: 5// rm_poll_240us = LABEL: 342// rm_wait_500us = LABEL: 330// rm_wait_60us = LABEL: 337// rmc_data_loop = LABEL: 117// rmc_line_loop = LABEL: 110// rsc_crc16_fail = LABEL: 272// rsc_loop = LABEL: 239// rx_data_present = CONSTANT: 4// rx_full = CONSTANT: 16// rx_half_full = CONSTANT: 8// s0 = REGISTER: 0// s1 = REGISTER: 1// s2 = REGISTER: 2// s3 = REGISTER: 3// s4 = REGISTER: 4// s5 = REGISTER: 5// s6 = REGISTER: 6// s7 = REGISTER: 7// s8 = REGISTER: 8// s9 = REGISTER: 9// sA = REGISTER: 10// sB = REGISTER: 11// sC = REGISTER: 12// sD = REGISTER: 13// sE = REGISTER: 14// sF = REGISTER: 15// send_Byte = LABEL: 799// send_CR = LABEL: 543// send_CRC = LABEL: 924// send_Command = LABEL: 854// send_DS2432_menu = LABEL: 659// send_ES = LABEL: 894// send_Fail = LABEL: 845// send_HHelp = LABEL: 720// send_Master_Reset = LABEL: 775// send_Memory = LABEL: 741// send_OK = LABEL: 713// send_Pass = LABEL: 837// send_ROM = LABEL: 734// send_ROM_menu = LABEL: 632// send_Read = LABEL: 817// send_Scratchpad = LABEL: 754// send_Skip = LABEL: 808// send_Write = LABEL: 826// send_address = LABEL: 868// send_code = LABEL: 902// send_data = LABEL: 884// send_equals = LABEL: 881// send_hex_3bytes = LABEL: 500// send_hex_byte = LABEL: 494// send_minus = LABEL: 549// send_reset_menu = LABEL: 623// send_serial = LABEL: 911// send_space = LABEL: 546// send_to_UART = LABEL: 440// send_welcome = LABEL: 552// serial_number0 = CONSTANT: 1// serial_number1 = CONSTANT: 2// serial_number2 = CONSTANT: 3// serial_number3 = CONSTANT: 4// serial_number4 = CONSTANT: 5// serial_number5 = CONSTANT: 6// skip_ROM_command = LABEL: 98// spare1 = CONSTANT: 32// spare2 = CONSTANT: 64// spare3 = CONSTANT: 128// status_port = CONSTANT: 0// test_for_ten = LABEL: 447// twochar_to_value = LABEL: 463// tx_full = CONSTANT: 2// tx_half_full = CONSTANT: 1// upper_case = LABEL: 453// wait_1ms = LABEL: 420// wait_1s = LABEL: 430// wait_1us = LABEL: 411// wait_20ms = LABEL: 425// wait_40us = LABEL: 415// wbs1 = LABEL: 358// wbs_loop = LABEL: 354// welcome_start = LABEL: 2// whs_wait_72us = LABEL: 382// whs_wait_8us = LABEL: 376// wls_wait_78us = LABEL: 365// write_High_slow = LABEL: 373// write_Low_slow = LABEL: 362// write_byte_command = LABEL: 195// write_byte_slow = LABEL: 353// write_scratchpad_command = LABEL: 129// wsc_addr_loop = LABEL: 134// wsc_crc16_fail = LABEL: 193// wsc_data_loop = LABEL: 154/* Program Code */// #1: ; KCPSM3 Program - Communication with DS2432 secure memory on the Spartan-3E Starter Kit.// #2: ;// #3: ; Ken Chapman - Xilinx Ltd// #4: ;// #5: ; Version v1.00 - 5th April 2006// #6: ;// #7: ; This program uses a 9600 baud UART connection to allow communication with the// #8: ; 1-wire interface of the DS2432 memory device from Dallas Semiconductor.// #9: ;// #10: ; The program only supports a limited number of the DS2432 commands but is intended// #11: ; to guide you through the state machine of the device as well as show how// #12: ; 1-wire communication is achieved. The DS2432 also uses 8 and 16 bits CRC checks and// #13: ; this program includes these calculations to validate the communications.// #14: ;// #15: ; Commands supported include read ROM, write scratchpad memory and read scratchpad// #16: ; memory. These allow you to confirm the ability to both read and write data but// #17: ; at no time modify the actual EEPROM secure memory or secret.// #18: ;// #19: ; There are then two manual commands which allow you to write any byte value that// #20: ; you enter and to read a byte from the DS2432 device. At this point you are free// #21: ; to experiment and this may result in the device contents being altered. You also// #22: ; become responsible for tracking the states but remember that a master reset will// #23: ; always return you to a known starting point again.// #24: ;// #25: ;// #26: ;**************************************************************************************// #27: ; Port definitions// #28: ;**************************************************************************************// #29: ;// #30: ;// #31: CONSTANT(status_port,0) ;UART status input// #32: CONSTANT(tx_half_full,1) ; Transmitter half full - bit0// #33: CONSTANT(tx_full,2) ; FIFO full - bit1// #34: CONSTANT(rx_data_present,4) ; Receiver data present - bit2// #35: CONSTANT(rx_half_full,8) ; FIFO half full - bit3// #36: CONSTANT(rx_full,16) ; full - bit4// #37: CONSTANT(spare1,32) ; spare '0' - bit5// #38: CONSTANT(spare2,64) ; spare '0' - bit6// #39: CONSTANT(spare3,128) ; spare '0' - bit7// #40: ;// #41: CONSTANT(UART_read_port,1) ;UART Rx data input// #42: ;// #43: CONSTANT(UART_write_port,4) ;UART Tx data output// #44: ;// #45: ;// #46: CONSTANT(DS_wire_in_port,2) ;Read signal from DS2432 device// #47: CONSTANT(DS_wire_out_port,8) ;Drive signal to DS2432 device (open collector)// #48: CONSTANT(DS_wire,1) ; Signal is bit0 in both cases// #49: ;// #50: ;// #51: ;// #52: ;// #53: ;**************************************************************************************// #54: ; Special Register usage// #55: ;**************************************************************************************// #56: ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -