Hi Team,
I am trying to implement a driver using SPI for the ADBMS1818 chip which is used to measure the Cell voltages of battery cells. To start measuring the voltage using the ADC . I have to do a start poll operation (PLADC). After which I shall use another command to read the ADC values (say for eg : RDCVA).
When I ask the chip to start measuring ( PLADC) I have to wait for a specific amount of time depending on the number of cells being measured. The operation is shown in the image attached.
My doubt is with PLADC command. Is there a way to know when the request for conversion has been done based on the SDO line activity? I currently use spiStartExchange. Can `end_cb` in the SPI device descriptor be used for this purpose ?
Regards,
Akshai
SPI Hal - Waiting to MISO line to be released
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: SPI Hal - Waiting to MISO line to be released
Hi,
I think you could use GPIO (PAL driver) and poll for completion or to wait for a rising edge.
You could also keep doing spiReceive() until you get an 0xFF if the extra clocks are tolerated by the ADC.
Giovanni
I think you could use GPIO (PAL driver) and poll for completion or to wait for a rising edge.
You could also keep doing spiReceive() until you get an 0xFF if the extra clocks are tolerated by the ADC.
Giovanni
Re: SPI Hal - Waiting to MISO line to be released
Hi Giovanni,
Thank you for the reply. Unfortunately, I cannot wait as it will kill the timings. Is there a possibility for an asynchronous way to do it?
Regards,
Akshai
Thank you for the reply. Unfortunately, I cannot wait as it will kill the timings. Is there a possibility for an asynchronous way to do it?
Regards,
Akshai
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: SPI Hal - Waiting to MISO line to be released
Waiting for a rising edge is asynchronous, it triggers a callback. See PAL callbacks.
Giovanni
Giovanni
Re: SPI Hal - Waiting to MISO line to be released
Thanks Giovanni. I shall explore that
Regards,
Akshai
Regards,
Akshai
Re: SPI Hal - Waiting to MISO line to be released
Instead of polling via GPIO I ended up sending an empty requests using DMA and have callback check for `0xFF` in Rx buffer which shows the device is free . This ended up being the easiest option
Who is online
Users browsing this forum: No registered users and 16 guests