Hi folks, My basic problem is getting ADCMEM values stored in records suitable for the MCP2150 IrDA chip and the MMC (MultiMedia card). I'm a bit lost on pointers, structures, and unions. Here's what I have: -------------------------- int *pADCMEM; //pointer to ADC12MEM
struct MMCrec { uint8_t P1; //Port 1 pins define which leads are connected; uint8_t mode; //Defines which channels to read uint16_t reccount; //OK if it overflows, integrity check int ADC[30]; // [10][3], [6][5], or [5][6] }; union { struct MMCrec MMCblk[8]; uint16_t u16[256]; // uint16_t uA16[8][32]; int i16[256]; //to subract ((AVcc -AVss)/2)*4 int iA16[8][32]; uint8_t u8[512]; //MMC record uint8_t uA8[8][64]; //IrDA records } MMC_buffer; // Intermediate buffer for the ADC // It gets copied to MMC_buffer uA16[n][2], 8>n>0, when full. // It takes at from 20ms to 40ms to fill this buffer, depending on lead config. uint16_t ADC12buffer[6]; //sums of 8 or 16 readings from ADC12MEM uint16_t *pADC12buffer; struct MMCrec->MMCblk[1] *pRecord; int MMC_buffer->MMCrec->MMCblk->ADC[0] *pADCvalue ------------------------------ I'm trying to fill an IrDA record, send it out port, Advance to the next record When the block is full, write to the MMC Start over. TIA for any help, Garst