This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

lmp90100 programming....!!!!!

Other Parts Discussed in Thread: LMP90100
I was going through LMP90100 pdf (Microcontroller Firmware Considerations for the National LMP90100 Sensor AFE) SNAA075 for interfacing LMP90100 with PICs.
In the example code routines there was function given to write the data in controller memory to the device...In that can you explain me this.  
//get the register upper 8bit address
instruction = (reg_addr >> 4) & 0x7;
instruction |= SPI_SEGMENT;
In it right shifting is done by 4.....why???
and also plz help me with these lines too....i am doing on mikroC PRO for pic
void write_spi8(UINT8 data)
{
spiA->SPI_TDR =data; // Send data - Starts as soon as this completes
while ((spiA->SPI_SR & TRANSFER_DONE) == 0); // Wait for transfer done
}
// read 8 bit data through spi
void read_spi8(UINT8 *data)
{
spiA->SPI_TDR =0xFF;                                                       //Send data - Starts as soon as this completes
while ((spiA->SPI_SR & TRANSFER_DONE) == 0);    // Wait for transfer done
*data = (spiA->SPI_RDR & 0x000000FF);
}
Thanks...!!
  • Hi mrinalini,

    The second half of your posting/question is just a simple bit-bang routine that communicates with the LMP90100.  I'm not sure why there is only a four bit shift in the first part though, one of our LM90100 experts will be able to clarify that shortly.   

  •  

        In oreder to pregarm the lmp90100 register, the segment must be sent to spi bus first. The bits(5`7) are segment number. They must be programmed frist, this is why shfting 4 bits to get  bit 5`7. You can get more explaintion in lmp90100 data sheet.

     
    and also plz help me with these lines too....i am doing on mikroC PRO for pic

     What do you ask for?

  • ok... i understood your point...

    i want to program lmp90100 through pic18f4523( SPI INTERFACE ) as i had studied the datasheet and tried to program it ...i am able to send data as i am getting it on oscilloscope but not able to recieve back any by lmp90100..i want to ask did my lmp90100 getting reset or not.. any help or tips regarding programming is  appreciated....

    In program i had assign address to each register , INITIALIZE controller , initialize spi, then write and read values in each register whose address are assigned..

    thanks...