Christian Eilers

Using A/D converter in 802.15.4 MAC SW

Discussion created by Christian Eilers on Aug 8, 2007
Latest reply on Aug 9, 2007 by Christian Eilers

I'm using the MC9S08GT60 and I want to transmit data of the ADC from a device to a coordinator in a 802.15.4 network. My actual problem is not the transmitting of the data but the correct use of the ADC.

I want to use PTB2 and so I initialize the registers as follows:
  ATDPE=0b00000100;  ATDC=0b10100000;  ATDSC=0b00100010;  test=ATDRH;

So I would expect that test contains the value of the last conversion, but it just contains a 1 which isn't correct.

The problem I have is if I use exactly (!!) the same code in a "normal" Code Warrior project without any MAC software, it works fine and the register of the MCU contains the values I expected.

Has anybody an idea what I have to do to use the ADC in combination with the 802.15.4 MAC SW?