User Tools

Site Tools


dev8051:code8051

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
dev8051:code8051 [2026/01/21 00:05] – [Code: RFID module and OLED] azmandev8051:code8051 [2026/01/21 00:05] (current) azman
Line 387: Line 387:
  lcd_goto_line2();  lcd_goto_line2();
  lcd_puts("                ");  lcd_puts("                ");
- } 
- } 
-} 
-/*----------------------------------------------------------------------------*/ 
-</file> 
-++++ 
- 
-==== Code: Testing Base Kit ==== 
- 
-++++ Testing Base Kit (202425s1). | 
-<file c nmk322_basetest.c> 
-/*----------------------------------------------------------------------------*/ 
-/* override default tick values */ 
-#define TIMER_TICK_LEN TIMER_VAL50MS 
-#define TIMER_TICK_CNT TIMER_LOOP_1S 
-/*----------------------------------------------------------------------------*/ 
-#include "my1stc51.h" 
-#include "timer_tick.h" 
-#include "led7seg.h" 
-/*----------------------------------------------------------------------------*/ 
-void main(void) { 
- unsigned char loop, mask, seg7[] = { _7SEGNUM_CC_ }; 
- P1MODE1(); // better pullup current 
- loop = 0; mask = (!P2_7)?0xff:0x00; 
- P1 = seg7[loop] ^ mask; 
- timer_init(); 
- timer_tick_exec(); 
- while (1) { 
- P2_0 = !P3_7; 
- P2_1 = !P3_6; 
- P2_2 = !P3_5; 
- P2_3 = !P3_4; 
- if (timer_ticked()) { 
- loop++; if (loop==10) loop = 0; 
- mask = (!P2_7)?0xff:0x00; 
- P1 = seg7[loop] ^ mask; 
- timer_tick00(); 
  }  }
  }  }
Line 513: Line 476:
  loop_delay(3000);  loop_delay(3000);
  oled1306_clear_row(3);  oled1306_clear_row(3);
 + }
 + }
 +}
 +/*----------------------------------------------------------------------------*/
 +</file>
 +++++
 +
 +==== Code: Testing Base Kit ====
 +
 +++++ Testing Base Kit (202425s1). |
 +<file c nmk322_basetest.c>
 +/*----------------------------------------------------------------------------*/
 +/* override default tick values */
 +#define TIMER_TICK_LEN TIMER_VAL50MS
 +#define TIMER_TICK_CNT TIMER_LOOP_1S
 +/*----------------------------------------------------------------------------*/
 +#include "my1stc51.h"
 +#include "timer_tick.h"
 +#include "led7seg.h"
 +/*----------------------------------------------------------------------------*/
 +void main(void) {
 + unsigned char loop, mask, seg7[] = { _7SEGNUM_CC_ };
 + P1MODE1(); // better pullup current
 + loop = 0; mask = (!P2_7)?0xff:0x00;
 + P1 = seg7[loop] ^ mask;
 + timer_init();
 + timer_tick_exec();
 + while (1) {
 + P2_0 = !P3_7;
 + P2_1 = !P3_6;
 + P2_2 = !P3_5;
 + P2_3 = !P3_4;
 + if (timer_ticked()) {
 + loop++; if (loop==10) loop = 0;
 + mask = (!P2_7)?0xff:0x00;
 + P1 = seg7[loop] ^ mask;
 + timer_tick00();
  }  }
  }  }
dev8051/code8051.1768925100.txt.gz · Last modified: by azman