44
Chapter 4. Programming
void main(void) {
unsigned char value;
CAN.P0PDR = 0xf0; /* configure CAN P0 pins 0-3 for input and */
/* pins 4-7 for output */
while(1) {
value = CAN.P0PR; /* read CAN P0 port */
value <<= 4; /* shift low nibble to high nibble */
CAN.P0LR = value; /* output data at CAN P0 pins 4-7 */
}
}
Use the following command lines to compile and link the external CAN example
program or set up a project with µVision which does the same. The options are
the same as for the BLINKY example:
C51 CANPORT.C DEBUG OE
Use the following command line to link:
L51 CANPORT.OBJ CODE(0100H)
and the following command line to generate an Intel HEX file:
OH51 CANPORT
You may then use the CANPORT.HEX file to program an EPROM or the
CANPORT file to load into monitor 51 or dScope.
Содержание MCB517AC
Страница 6: ...vi Contents...
Страница 23: ...MCB517AC Evaluation Board User s Guide 17 Schematics...
Страница 24: ...18 Chapter 3 Hardware...
Страница 25: ...MCB517AC Evaluation Board User s Guide 19...
Страница 26: ...20 Chapter 3 Hardware...
Страница 27: ...MCB517AC Evaluation Board User s Guide 21 Printed Board Assembly...
Страница 32: ...26 Chapter 3 Hardware...
Страница 34: ......