芯片解密,芯片破解,IC解密,单片机解密,MCU解密,STM解密

飞芯科技提供芯片解密,芯片破解,IC解密,单片机解密,MCU解密,STM解密逆向服务

芯片解密C8051F350单片机红外语音系统源程序

芯片解密单片机源程序如下:

  1. #include "include.h"
  2. #include "sw_uart.h"
  3. #include "hw_uart.h"
  4. #include "timer2.h"
  5. #include "api.h"

  6. pt pt_comm;

  7. void init_gpio()
  8. {
  9.     // P0.0  -  Skipped,     Open-Drain, Digital
  10.     // P0.1  -  Skipped,     Open-Drain, Digital
  11.     // P0.2  -  Skipped,     Open-Drain, Digital
  12.     // P0.3  -  Skipped,     Open-Drain, Digital
  13.     // P0.4  -  TX0 (UART0), Push-Pull,  Digital
  14.     // P0.5  -  RX0 (UART0), Open-Drain, Digital
  15.     // P0.6  -  Skipped,     Open-Drain, Digital
  16.     // P0.7  -  Skipped,     Open-Drain, Digital

  17.     // P1.0  -  Skipped,     Open-Drain, Digital
  18.     // P1.1  -  CEX0 (PCA),  Open-Drain, Digital
  19.     // P1.2  -  Unassigned,  Open-Drain, Digital
  20.     // P1.3  -  Unassigned,  Open-Drain, Digital
  21.     // P1.4  -  Unassigned,  Open-Drain, Digital
  22.     // P1.5  -  Unassigned,  Open-Drain, Digital
  23.     // P1.6  -  Unassigned,  Push-Pull,  Digital
  24.     // P1.7  -  Unassigned,  Push-Pull,  Digital
  25.     // P2.0  -  Unassigned,  Open-Drain, Digital
  26.     // P2.1  -  Unassigned,  Open-Drain, Digital
  27.     // P2.2  -  Unassigned,  Open-Drain, Digital
  28.     // P2.3  -  Unassigned,  Open-Drain, Digital

  29.     P0MDOUT   = 0x10;
  30.     P1MDOUT   = 0xC0;
  31.     P0SKIP    = 0xCF;
  32.     P1SKIP    = 0x01;
  33.     XBR0      = 0x01;
  34.     XBR1      = 0x41;
  35. }

  36. void init_sysclock()
  37. {
  38.     OSCICN    = 0x83;
  39. }

  40. void init_wtd(void)
  41. {
  42.         //        PCA0MD    &= ~0x40;        // 向WDTE写‘0’,禁止WDT   
  43.         //        PCA0MD    = 0x00;        // PCA时钟源选择系统时钟的12分频   
  44.         //        PCA0CPL2  = 0xFF;        // 装入WDT更新偏移值为64.2ms   
  45.         //        PCA0MD    |= 0x40;        // 向WDTE写‘1’,使能WDT

  46.         // Calculate Watchdog Timer Timeout
  47.         // Offset calculated in PCA clocks
  48.         // Offset = ( 256 x PCA0CPL4 ) + 256 - PCA0L
  49.         //        = ( 256 x 255(0xFF)) + 256 - 0
  50.         // Time   = Offset * (12/SYSCLK)   
  51.         //        = 255 ms ( PCA uses SYSCLK/12 as its clock source)               
  52.         PCA0MD  &= 0xBF;                          // WDTE = 0 (clear watchdog timer enable)
  53. //        PCA0L    = 0x00;                       // Set lower byte of PCA counter to 0  
  54. //        PCA0H    = 0x00;                       // Set higher byte of PCA counter to 0
  55.         PCA0CPL4  = 0xFF;               // Write offset for the WDT
  56.         PCA0MD  |= 0x40;                       // Enable the WDT
  57. }

  58. void feed_wtd(void)
  59. {
  60.         //CCF2  = 0x00;                                // Write a 'dummy' value to the PCA0CPH4
  61.                                                                    // register to reset the watchdog timer
  62.                                                                    // timeout. If a delay longer than the
  63.                                                                    // watchdog timer delay occurs between
  64.                                                                    // successive writes to this register,
  65.                                                                 // the device will be reset by the watch
  66.                                                                 // dog timer.
  67.         PCA0CPH4 =0x00;  
  68. }

  69. unsigned char get_lamp_status(void)
  70. {
  71.         if(PIN_RED_LAMP==0) return 1;
  72.         else return 0;
  73. }



联系方式

地址:石家庄市新华区民族路77号华强广场D座2009
电话:0311-88816616/87087811
手机:13315190088
传真:0311-67901001
联系人:张工
网址:www.taihedz.cn
邮箱:feixindz@163.com
微信:xinpianjiemi
QQ:527263666/568069805

在线客服
热线电话

企业微信