⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chap1.c

📁 摩托罗拉Mc6805利程
💻 C
字号:
// Chapter 1 6805 C programs// Jonathan W. Valvano// This software accompanies the book,// Embedded Microcomputer Systems: Real Time Interfacing// published by Brooks Cole, 1999// Program 1.17. C software that initializes an I/O port to input.// MC68HC705J1A    DDRA=0x00;// Program 1.19. C software that reads from an I/O port input.// MC68HC705J1A    Happiness=PORTA;// Program 1.21. C software that initializes an I/O port to output.// MC68HC705J1A    DDRA=0x0F;// Program 1.23. C software that outputs an I/O port output.// MC68HC705J1A    PORTA=0xFF;// Program 1.25. C functions that provide initialization, //        read and write access an I/O port.// MC68HC705J1Avoid Init(unsigned char value){    DDRA=value;}void Set(unsigned char value){    PORTA=value;}unsigned char Read(void){    return(PORTA);}// Program 1.28. C programs that implement the 4 bit NOT gate.// HC05C4, HC708XL36, HC11A8, HC812A4void init(void){    DDRC=0xF0;} // PC7-PC4 are outputs, PC3-PC0 are inputsvoid main(void){ unsigned char data;    init();     // call ritual once    while(1){       data=PORTC;      // input       data=(~data)<<4; // complement and shift       PORTC=data;}}    // output

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -