EPUBThe A/D inputs are used as analog signals input port; they are converted into the M16C microcontroller in the AD repeat mode. The host PC then reads the digitized number in the three registers of the each AD channel. The host draws the signals on the virtual oscilloscope interface. Step 2: Hardware Hardware: The three A/D inputs are: 1- AN1 (connected to the photo resistor) 2- AN4 (connected to the kit‘s I/O connector) 3- AN5 (connected to the kit‘s I/O connector) The Kit I received form Renesas had I/O ports and some of them are analog input. I connected pin headers to the analog input ports. Step 3: PC Software and Embedded Software Firmware: Addresses of the three registers that contain digitized signals are AN1 3C2h 962 AN4 3C8h 968 AN5 3CAh 970 Here is part of Firmware code: Description: Initialization of a AD converter on AN1 *****************************************************************************/ void InitAD( void ) { // adcon0 = 0x09; /* sw trigger, repeat mode, AN1 */ // THIS IS ORIGINAL FOR CDS // adcon1 = 0x20; /* vref connected, 8 bit mode */ // adcon2 = 0x01; /* P10 group, sample and hold */ adcon0 = 0x09; /* sw trigger, repeat mode, AN1 */ //// THIS IS ADDED BY ABOHMEED FOR AN4 adcon1 = 0x20; /* vref connected, 8 bit mode */ adcon2 = 0x01; /* P10 group, sample and hold */ adst = 1; /* start conversion */ } Software: The host PC runs a VB express program which read from the mentioned addresses on the user selection of the desired input port and handles this
Rate this eBook
| File Name: | b540e53e58dd629ac58bdce683bef67f.epub |
| Original Title: | Embedded Systems, Electronics |
| Creator / Author: | Ebeed, Ahmed |
| Language: | English (en) |
| Identifier: | ASIN:261926 |
| Publisher: | Ebeed, Ahmed Publishing |
| Category: | Self help |
| Format: | 📗 EPUB eBook |
| File Size: | 3.5 MB |
.jpg)


