freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于51單片機的led立方體顯示器設(shè)計-預覽頁

2024-07-08 15:15 上一頁面

下一頁面
 

【正文】 個雙向 I/O 口 256x8bit 內(nèi)部 RAM 3 個 16 位可編程定時 /計數(shù)器中斷 時鐘頻率 024MHz 10 2 個串行中斷 可編程 UART 串行通道 2 個外部中斷源 共 6 個中斷源 2 個讀寫中斷口線 3 級加密位 低功耗空閑和掉電模式 軟件設(shè)置睡眠和喚醒功能 圖 331 STC89C52 管腳圖 STC89C52 管腳介紹: (1)主電源引腳 VCC(40):電源輸入,接+ 5V電源 GND(20):接地線 (2)外接晶振引腳 XTAL0(18):片內(nèi)振蕩電路的輸入端 XTAL1(19):片內(nèi)振蕩電路的輸出端 (3)控制引腳 RST/VPP(9):復位引腳,引腳上出現(xiàn) 2 個機器周期的高電平將使單片機復位。 P0 口是一個 8 位漏極開路的雙向 I/O口。對 P1 端口寫 “1” 時,內(nèi)部上拉電阻把端口拉高,此時可以作為輸入口使用。對 P2 端口寫 “1” 時,內(nèi)部上拉電阻把端口拉高,此時可以作為輸入口使用。對 P3 端口寫“1” 時,內(nèi)部上拉電阻把端口拉高,此時可以作為輸入口使用。 ALE/PROG—— 當訪問外部程序存儲器或數(shù)據(jù)存儲器時, ALE(地址鎖存允許)輸出脈沖用于鎖存地址的低 8位字節(jié)。 12 EA/VPP—— 外部訪問允許,欲使 CPU 僅訪問外部程序存儲器(地址為 0000HFFFFH),EA 端必須保持低電平(接地)。輸出控制不影響鎖存器的內(nèi)部工作,即老數(shù)據(jù)可以保持,甚至當輸出被關(guān)閉時,新的數(shù)據(jù)也可以 置入。 圖 3321 晶振電路圖 STC89C52內(nèi)部有一 個用于構(gòu)成振蕩器的高增益反相放大器,引腳 XTAL0和 XTAL1分別是此放大器的輸入端和輸出端。晶體振蕩頻率可以在 ~12MHz之間選擇,電容值在 5~ 30pF之間選擇,電容值的大小可對頻率起微調(diào)的作用。 (二)復位電路 最小系統(tǒng)復位電路如圖 3322所示 16 圖 3322復位電路圖 無論使用哪種類型的單片機,總要涉及到單片機復位電路的設(shè)計.而單片機復位電路設(shè)計的好壞,直接影響到整個系統(tǒng)工作的可靠性.許多用戶在設(shè)計完單片機系統(tǒng),并在實驗室調(diào)試成功后,在現(xiàn)場卻出現(xiàn)了“死機”、“程序走飛”等現(xiàn)象 ,這主要是單片機的復位電路設(shè)計不可靠引起的。 8 塊 74HC573 是控制 512個 LED 的關(guān)鍵所在,通過這些芯片可以獨立的控制每一個 LED,讓光立方能顯示心中所想成為可能。 顯示模塊 顯示模塊由 512 只 LED 焊接而成,每只 LED 都需要進行引腳的彎折,然后精確的完成焊接工作。start: ljmp qishi //跳轉(zhuǎn)到起始指令 //檢查程序 看 led 是否有損壞 /* jiancha:mov p2,00H //開啟 p2 口 mov p1,0ffH //同步輸出 mov p3,00H //開啟 p3 口 jmp jiancha //無限循環(huán) //起始程序 關(guān)閉所有 led qishi: acall guanbi //調(diào)用關(guān)閉程序 。 acall anjian //檢測按鍵 djnz r1,loop21 //判斷重復次數(shù) 不滿 5 次繼續(xù)循環(huán) acall guanbi //調(diào)用關(guān)閉程序 //束移程序 xiayu: mov r0,3 //第 3 條程序 dec r0 //r1 與 r2 賦值為 0~5 loop31: mov r1,5 //為縱向賦值 mov r2,0 //為橫向賦值 acall loop32 //調(diào)用束移效果程序 mov r1,2 mov r2,2 acall loop32 mov r1,1 mov r2,4 acall loop32 mov r1,3 mov r2,2 acall loop32 mov r1,5 mov r2,3 acall loop32 mov r1,2 mov r2,0 acall loop32 mov r1,1 mov r2,5 acall loop32 20 mov r1,2 mov r2,4 acall loop32 mov r1,3 mov r2,1 acall loop32 mov r1,0 mov r2,2 acall loop32 mov r1,3 mov r2,0 acall loop32 mov r1,4 mov r2,0 acall loop32 mov r1,0 mov r2,2 acall loop32 ljmp an loop32: acall guanbi //初始 化 acall yudian //束移位置查表 acall xia //調(diào)用左移程序 acall bo2 //橫向移動查表 acall suo //鎖存 acall bo1 //縱向移動查表 acall suo2 //鎖存 acall delay1 //調(diào)用延時 acall guanbi ret //返回 21 xia: mov r4,8 //循環(huán) 8 次 mov r3,80H //初始從第一層開始 loop33: mov p3,r3 //將 p3 口顯示 r3 值 mov a,r3 //開始右移 rr a mov r3,a //結(jié)果存入 r3 acall delay1 //調(diào)用延時 。 TH0 = (6553650000)/256。i++) for(j=0。 while(!TI)。 UART_Send(cColumn)。 x 0 。 z 6 。 } // Set a single voxel to OFF void clrvoxel(int x, int y, int z) { if (inrange(x,y,z)) cube[x][y] amp。 } // This function validates that we are drawing inside the cube. unsigned char inrange(int x, int y, int z) { if (x = 0 amp。 y = 0 amp。 z = 0 amp。 } 27 } // Get the current status of a voxel unsigned char getvoxel(int x, int y, int z) { if (inrange(x,y,z)) { if (cube[x][y] amp。 } } // In some effect we want to just take bool and write it to a voxel // this function calls the apropriate voxel manipulation function. void altervoxel(int x, int y, int z, int state) { if (state == 1) { setvoxel(x,y,z)。 tmp = ix1。 *ox2 = ix2。 xCUBE_SIZE) { for (i=0。 if (x=0 amp。i++) cube[x][i] = 0x00。amp。yCUBE_SIZE。 if (z=0 amp。x++) { for (y=0。 } } } } void setplane_y (int y) { int z。zCUBE_SIZE。amp。 30 } } void setplane (char axis, unsigned char i) { switch (axis) { case AXIS_X: setplane_x(i)。 case AXIS_Z: setplane_z(i)。 case AXIS_Y: clrplane_y(i)。 } } //////////////////////////////////////////////////// // Fill a value into all 64 byts of the cube buffer // Mostly used for clearing. fill(0x00) // or setting all on. fill(0xff) void fill (unsigned char pattern) { 31 int x。x++) { for (y=0。 int y。yCUBE_SIZE。 ~(0xff(end+1)))。x1, amp。y2)。 for (ix=x1。iy++) { cube[ix][iy] |= byteline(z1,z2)。x1, amp。y2)。 for (ix=x1。iy++) { if (iy == y1 || iy == y2 || ix == x1 || ix == x2) { cube[ix][iy] = byteline(z1,z2)。 argorder(x1, x2, amp。y1, amp。z2)。 cube[x2][y2] = byteline(z1,z2)。 setvoxel(x1,iy,z2)。ix=x2。 setvoxel(ix,y2,z2)。 unsigned char lasty,lastz。 x1 = tmp。 tmp = z2。 lasty = y2。 lastz = z2。 x=x2。 } } void tmp2cube (void) { memcpy(cube, fb, 64)。 for (i = 0。 } for (x = 0。 y++) { if (direction == 1) { iii = ii+1。 } if (axis == AXIS_Y) { state = getvoxel(x,iii,y)。 } } } } if (direction == 1) { i = 7。 x++) { for (y = 0。 if (axis == AXIS_X) clrvoxel(i,y,x)。amp。amp。amp。amp。amp。amp。amp。amp。 if (lol == 1) dy = 0。 dx == 1) 37 dx = 1。 if (z == 0 amp。amp。 dy == 1) dy = 1。 // Finally, move the voxel. x = x + dx。 delay_ms(delay)。 } if (drawmode == 0x03) // draw a snake { for (i=7。 snake[i][2] = snake[i1][2]。 for (i=0。 for (i=0。 } } // Set or clear exactly 512 voxels in a random order. void effect_random_filler (int delay, int state) { int x,y,z。 } while (loop511) { x = rand()%8。amp。 delay_ms(delay)。 fill(0x00)。 destinations[i] = rand()%
點擊復制文檔內(nèi)容
畢業(yè)設(shè)計相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1