Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

How is process image size going to do with Blinking of LED

Hi! i am currently using keil software for LPC 2129. i am very new and hope to find some help! i am studying this example 'CANBlinky' right now.

In this example, it mentioned about the process image size i.e.

in MCO.h:

// Define the size of the process image
#define PROCIMG_SIZE 16

// Define process variables: offsets into the process image
// Digital Input 1
#define IN_digi_1 0x00
// Digital Input 2
#define IN_digi_2 0x01
// Digital Input 3
#define IN_digi_3 0x02
// Digital Input 4
#define IN_digi_4 0x03

// Analog Input 1
#define IN_ana_1 0x04
// Analog Input 2
#define IN_ana_2 0x06

// Digital Output 1
#define OUT_digi_1 0x08
// Digital Output 2
#define OUT_digi_2 0x09
// Digital Output 3
#define OUT_digi_3 0x0A
// Digital Output 4
#define OUT_digi_4 0x0B

// Analog Output 1
#define OUT_ana_1 0x0C
// Analog Output 2
#define OUT_ana_2 0x0E

in BlinkyCAn.c :

// Get analog input from ADC
ana = getAD();
gProcImg[IN_ana_1] = (BYTE) ana;
gProcImg[IN_ana_1+1] = (BYTE) (ana >> 8);

// Echo analog output received
gProcImg[IN_ana_2] = gProcImg[OUT_ana_1];
gProcImg[IN_ana_2+1] = gProcImg[OUT_ana_1+1];

// Transmit timer values
gProcImg[IN_digi_1] = (BYTE) comp;
gProcImg[IN_digi_2] = (BYTE) (comp >> 8);
gProcImg[IN_digi_3] = (BYTE) gTimCnt;
gProcImg[IN_digi_4] = (BYTE) (gTimCnt >> 8);

// Calculate next compare value
ana = gProcImg[OUT_ana_1+1];
ana <<= 8;
ana += gProcImg[OUT_ana_1];

my questions are
1) how is process image size going to do with the Blinking of LED?
Before this example, i studied the example 'Blinky'. it din use the process image size but the led still lighted up as wat is planned. How come in 'CANBlinky', process image is needed?

2) how does this analogy and digital value help in this example? What is their function?

Thanks a lot and hope to hear from someone soon!
0 Kudos
Message 1 of 1
(6,317 Views)