spi_prog.rmh
来自「和picoblaze完全兼容的mcu ip core」· RMH 代码 · 共 1,531 行 · 第 1/5 页
RMH
1,531 行
/* Symbol Table */// ASCII_byte_to_hex = LABEL: 516// ASCII_letter = LABEL: 539// ASCII_to_hex = LABEL: 529// ID_command = LABEL: 34// ISR = LABEL: 1013// ISR_preserve_s0 = CONSTANT: 0// MCS_address = LABEL: 185// MCS_address_boundary = LABEL: 161// SPI_FLASH_ID_fail = LABEL: 267// SPI_FLASH_ID_result = LABEL: 268// SPI_FLASH_tx_rx = LABEL: 274// SPI_adc_conv = CONSTANT: 16// SPI_amp_cs = CONSTANT: 8// SPI_amp_sdi = CONSTANT: 64// SPI_amp_shdn = CONSTANT: 64// SPI_control_port = CONSTANT: 8// SPI_control_status = CONSTANT: 4// SPI_dac_clr = CONSTANT: 128// SPI_dac_cs = CONSTANT: 32// SPI_init = LABEL: 270// SPI_input_port = CONSTANT: 2// SPI_output_port = CONSTANT: 4// SPI_rom_cs = CONSTANT: 2// SPI_sck = CONSTANT: 1// SPI_sdi = CONSTANT: 128// SPI_sdo = CONSTANT: 128// SPI_spare_control = CONSTANT: 4// UART_data = REGISTER: 15// UART_read_port = CONSTANT: 1// UART_write = LABEL: 453// UART_write_port = CONSTANT: 16// abort_erase = LABEL: 62// addr_out_of_sequence = LABEL: 134// bulk_erase_spi = LABEL: 371// bulk_erase_wait = LABEL: 381// byte_programmed = LABEL: 154// 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// close_prog_page_spi = LABEL: 399// cold_start = LABEL: 0// decimal_to_ASCII = LABEL: 455// delay_1ms = LABEL: 416// delay_1s = LABEL: 426// delay_1us = LABEL: 407// delay_1us_constant = CONSTANT: 11// delay_20ms = LABEL: 421// delay_40us = LABEL: 411// end_program_MCS = LABEL: 165// erase_command = LABEL: 51// erase_spi_sector = LABEL: 351// erase_test_sector = LABEL: 241// hex_byte_to_ASCII = LABEL: 486// hex_to_ASCII = LABEL: 498// isr_send_character = LABEL: 1020// isr_send_xon = LABEL: 1019// line_start = CONSTANT: 43// memory_blank_fail = LABEL: 255// memory_blank_result = LABEL: 256// memory_comms_test = LABEL: 258// memory_test = LABEL: 219// memory_verify_fail = LABEL: 238// memory_verify_result = LABEL: 239// new_low_address = LABEL: 196// next_SPI_FLASH_bit = LABEL: 276// next_prog_line = LABEL: 112// number_char = LABEL: 501// obtain_8bits = LABEL: 105// onechar_to_value = LABEL: 468// open_prog_page_spi = LABEL: 385// page_address_h = CONSTANT: 1// page_address_l = CONSTANT: 3// page_address_m = CONSTANT: 2// page_is_open = LABEL: 140// page_prog_wait = LABEL: 403// pattern_loop = LABEL: 223// program_MCS = LABEL: 111// program_byte = LABEL: 136// program_command = LABEL: 84// prompt = LABEL: 6// read_MCS_byte = LABEL: 173// read_MCS_line = LABEL: 169// read_XON = LABEL: 445// read_character = LABEL: 436// read_command = LABEL: 89// read_from_UART = LABEL: 431// read_spi_byte = LABEL: 334// read_spi_flash_ID = LABEL: 318// read_spi_flash_status = LABEL: 287// read_upper_case = LABEL: 29// reset_spi_flash_WREN = LABEL: 308// rx_data_present = CONSTANT: 8// rx_full = CONSTANT: 32// rx_half_full = CONSTANT: 16// 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// sector_erase_command = LABEL: 64// sector_erase_wait = LABEL: 367// send_Abort = LABEL: 842// send_CR = LABEL: 541// send_Confirm = LABEL: 813// send_Erase = LABEL: 682// send_Erase_in_progress = LABEL: 659// send_ID = LABEL: 808// send_MCS_file = LABEL: 641// send_Menu = LABEL: 701// send_OK = LABEL: 694// send_Waiting_MCS_file = LABEL: 620// send_hex_3bytes = LABEL: 509// send_hex_byte = LABEL: 503// send_page = LABEL: 799// send_page_address = LABEL: 855// send_space = LABEL: 544// send_spi_byte = LABEL: 206// send_spi_line = LABEL: 202// send_spi_page = LABEL: 201// send_to_UART = LABEL: 449// send_welcome = LABEL: 547// set_spi_flash_WREN = LABEL: 298// status_port = CONSTANT: 0// swap_bits = LABEL: 142// test_for_ten = LABEL: 456// twochar_to_value = LABEL: 472// tx_data_present = CONSTANT: 1// tx_full = CONSTANT: 4// tx_half_full = CONSTANT: 2// upper_case = LABEL: 462// verify_blank_page = LABEL: 249// verify_test_page = LABEL: 232// wait_1ms = LABEL: 417// wait_1s = LABEL: 427// wait_1us = LABEL: 408// wait_20ms = LABEL: 422// wait_40us = LABEL: 412// wait_MCS_line_Start = LABEL: 170// wait_Rx_character = LABEL: 432// wait_XON = LABEL: 441// warm_start = LABEL: 5// welcome_start = LABEL: 3/* Program Code */// #1: ;KCPSM3 Program - UART programming of SPI Flash memory on Spartan-3E Starter Kit.// #2: ;// #3: ;// #4: ;Ken Chapman - Xilinx Ltd// #5: ;// #6: ;Version v1.00 - 11th November 2005// #7: ;// #8: ;This program uses a 115200 baud UART connection with XON/XOFF flow control// #9: ;to allow a standard MCS file for the configuration of a Spartan-3E device to// #10: ;be programmed into the ST Microelectronics M25P16 device on the board.// #11: ;// #12: ;// #13: ;// #14: ;As well as the port connections vital to communication with the UART and the SPI// #15: ;FLASH memory, there are additional port connections used to disable the other// #16: ;devices sharing the SPI bus on the Starter Kit board. Although these could have been// #17: ;controlled at the hardware level, they are included in this code to aid// #18: ;future investigations of communication with the other SPI devices using PicoBlaze.// #19: ;// #20: ;// #21: ;// #22: ;// #23: ;Port definitions// #24: ;// #25: CONSTANT(status_port,0) ;UART and filter status input// #26: CONSTANT(tx_data_present,1) ; Transmitter data present - bit0// #27: CONSTANT(tx_half_full,2) ; FIFO half full - bit1// #28: CONSTANT(tx_full,4) ; full - bit2// #29: CONSTANT(rx_data_present,8) ; data present - bit3// #30: CONSTANT(rx_half_full,16) ; Receiver half full - bit4// #31: CONSTANT(rx_full,32) ; FIFO full - bit5// #32: ;// #33: CONSTANT(UART_read_port,1) ;UART Rx data input// #34: ;// #35: CONSTANT(UART_write_port,16) ;UART Tx data output// #36: ;// #37: ;// #38: CONSTANT(SPI_control_port,8) ;SPI clock and chip selects// #39: CONSTANT(SPI_sck,1) ; SCK - bit0// #40: CONSTANT(SPI_rom_cs,2) ; serial rom select - bit1// #41: CONSTANT(SPI_spare_control,4) ; spare - bit2// #42: CONSTANT(SPI_amp_cs,8) ; amplifier select - bit3// #43: CONSTANT(SPI_adc_conv,16) ; A/D convert - bit4// #44: CONSTANT(SPI_dac_cs,32) ; D/A select - bit5// #45: CONSTANT(SPI_amp_shdn,64) ; amplifier SHDN - bit6// #46: CONSTANT(SPI_dac_clr,128) ; D/A clear - bit7// #47: ;// #48: CONSTANT(SPI_output_port,4) ;SPI data output// #49: CONSTANT(SPI_sdo,128) ; SDO - bit7// #50: ;// #51: CONSTANT(SPI_input_port,2) ;SPI data input// #52: CONSTANT(SPI_sdi,128) ; SDI - bit7// #53: CONSTANT(SPI_amp_sdi,64) ; amplifier SDI - bit6// #54: ;// #55: ;// #56: ;// #57: ;// #58: ;Special Register usage// #59: ;// #60: NAMEREG(sF,UART_data) ;used to pass data to and from the UART// #61: ;// #62: ;// #63: ;Useful data constants// #64: ;// #65: ;// #66: ;Constant to define a software delay of 1us. This must be adjusted to reflect the// #67: ;clock applied to KCPSM3. Every instruction executes in 2 clock cycles making the// #68: ;calculation highly predictable. The '6' in the following equation even allows for// #69: ;'CALL delay_1us' instruction in the initiating code.// #70: ;// #71: ; delay_1us_constant = (clock_rate - 6)/4 Where 'clock_rate' is in MHz
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?