Hi
I'm using the TMS570LS1224 for a project and was wondering if I could use the pin 55 to generate the interrupt I need for the DRDY on the ADS1271 to start receiving the data on the MCU.
best regards
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.
Hi
I'm using the TMS570LS1224 for a project and was wondering if I could use the pin 55 to generate the interrupt I need for the DRDY on the ADS1271 to start receiving the data on the MCU.
best regards
Hi Miguel,
Pin 55 is shared between the MIBSPI3NCS[0]/AD2EVT/GIOB[2]/EQEP1I/N2HET2_PIN_nDIS functions. Among these, the input to the GIOB[2] can generate an interrupt. For this to work, you need to switch the input to the GIO module to come from pin 55 instead of the default pin 142. You can do this by configuring the I/O Multiplexing Module. HALCoGen can generate the necessary code for you as part of the muxInit() function once you configure the 'Special Pin Muxing" sub-tab from the PINMUX tab. The option is called "Use GIOB_2 for disablling selected HET2 PWM outputs". Select this check box and the generated muxInit() function will switch the GIOB[2] input for you.
Regards,
Sunil
Hi Miguel,
No need to worry about that. You can use all the pins of the NHET as usual. For the "NHET Pin Disable" Feature to work, you need to additionally configure the NHET to do so (by setting HETGCR register bit 24).
Thanks and Regards,
Vineeth
Hi Miguel,
Can you clarify what you mean by "3pin mode"?
Thanks and Regards,
Vineeth
Is referred to the point 28.2.2.3 from the reference manual of the MCU. Is a mode where you only connect the SPICLK, the SPISIMO and an interrupt to indicate the MCU the info is ready.
best regards =)
Hi,
You can configure SPI to work in 3 pin mode by configuring all the SPI_CS pins and SPI_EN as non-functional. If you are using HALCoGen, you can go to SPI Port Tab and configure those pins as GIO.
It is possible to configure interrupt for SPI TX and RX interrupts (to the MCU) by configuring the SPIINT0 register. Please refer to the TRM for register details.
Also, HALCoGen provides API to send and receive data in interrupt mode (Refer HALCoGen API spiSendData and spiGetData).
Hope this helps!
Thanks and Regards,
Veena
Miguel,
Well, I assume the psuedo-code should be interpreted liberally like the 'function' you want not the 'code' you want to write.
Because normally:
Miguel Amezcua Peregrina said:if(pin55 interrupt==1)
{
This would be handled by the interrupt hardware. From the GIO which detects the edge, to the
VIM that detects the interrupt from the GIO, to the CPU that finally gets the IRQ from the VIM.
Miguel Amezcua Peregrina said:stop all interrupts
This is done automatically by the CPU when you enter the ISR, in the sense that entering IRQ mode disables further interrupts at the ISR level. [it does *not* disable interrupts at the FIQ level which should be limited to ESM errors and it does not disable other exceptions like abort though.. just FYI..]
Miguel Amezcua Peregrina said:clean flag
This is normally handled after entering the ISR, so your description has this step and the previous one reversed.
I believe you will find that this step is done in the ISR generated by HalCoGen.
and laterMiguel Amezcua Peregrina said:disable pin 55 interrupt
Miguel Amezcua Peregrina said:enable pin 55 interrupt
Well you can do this but normally disabling all the interrupts covers this and you don't disable the pin interrupt specifically.
Normally you also keep the 'do something' code short so you are in/out of the ISR fast and interrupts are only disabled for a short time.
Miguel Amezcua Peregrina said:do something
HalCoGen uses the 'notification' callback function for this .. the ISR will call the notification function if you enable notifications. Usually it'll pass a parameter or two like which GIO port / pin interrupted.
You can look at the ISR generated by halcogen in the file "gio.c' to see what it does.
It will do everything you need except the 'do something' step.
For that it will call the notification function you provide, and you write the code for 'do something'.
Note: the interrupt handlers are not generated unless you check all the boxes to enable the GIO interrupt in the VIM.
So if you don't see them make sure you've got the interrupt enabled in the VIM and if not enable it and generate again.
(by 'the interrupt' I mean the specific channels for GIO need to be enabled or else the GIO ISR code won't be generated).
mmmm let me see if I get it correctly
if(pin55 interrupt==1)
{
stop all interrupts
clean flag
disable pin 55 interrupt
do something
enable all interrupts
enable pin 55 interrupt
}
The red lines: the if is to enter to the function. but that part, is done by using the notification halcogen generates? so it would be... if interrupt X then do the function?
do I need to clean the flag? or it is done by halcogen?
the enable all interrupts would be when finishing the interrupt right? and I could get rid og the disable/enable pin 55 interrupt?
The pin 55 of this MCU is the GIOB2, which I select on the special mux tab. But I did not find any option referent to it on the VIM channels tabs... so I don't know how to use it...
Im glad to know that... I saw one example but i fI need that. the reception starts when the pin 55 is in low... how could I do it? because thats when I need to start receiving the data...
Miguel,
There is a footnote in the datasheet that addresses this:
If you want to actually drive something onto pin 55 you have to use the other functions like AD2EVT as GIO mode.
Now remember that the input from the pins goes to all of the functions in the list, so you can drive IO & tristate the pin if you configure as AD2EVT as GIO but by setting the input pinmux so that GIOB[2] gets its input from pin 55.
Anthony
I just did a test. If I call the spi function, everything works. But when I try to call it with the interrupt, is not working...
this is the lines im using:
_enable_IRQ();
gioEnableNotification(gioPORTB,2);
am I missing something? why could the interrupt not be detected?
Here is the image of the oscillo. The interrupt should be occurring when the pin is driven low...
I already checked the registers
here is the code:
and I put a breakpioint on gioLowLevelInterrupt on the first line and it never reached that point...
here is the memory browser after I paused the debugger:
and the interrupt never arrives. But it should be arriving.... the ADS is sending the pulses, on the past image and the MCU was supposed to detect them no?
I found out something. look:
Here is the configuration used for the ADS
If you see on GIOB_2IN, we have a test point before the resistor.
Here is the test point just before the MCU
now here is the schematic did by Texas:
so the resistor is not the problem, since we have the same.
Here is the output from TP8 on my schematic:
which give us the right output.
and here is the output on TP6
For some reason Im getting a drop of voltaje somewhere, but I have no idea where. I know it doesnt come from the board itself. and neither from the resistor. I only know that when the MCU starts working TP6 shows this signal. What can I do?
Hi Anthony
Sorry for answering until now. For some reason the post got lost.
I already did what u asked for. I paused the debug, reset the system and restart it. the voltage droped the same. This is the image taken before the start of the debug. After starting it, the voltage drops.
I dont think the problem is the board because this happends only when I start the MCU so I think it can be a problem with the configuration
here are my files
I even added the muxInit() in case that was doing something... but idk, maybe the pin is being configured as output, which I dont think, or something wuth the pull up
**update
I really think is something on the configuration because the other pins dont have that problem...
Hi Anthony
I have checked the other board I have and happens the same. So... it most be a problem with the configuration...
Yes look at pinmux.c, you've got pin 55 configured as a MibSPI pin.
pinMuxReg->PINMMR9 = ((~(pinMuxReg->PINMMR9 >> 18U) & 0x00000001U ) << 18U) | PINMUX_PIN_54_HET1_31 | PINMUX_PIN_55_MIBSPI3NCS_0;
I notice that in the HalCoGen GUI it looks like this:
When no boxes are checked like they are in 55 row, then the HalCoGen generator will use the default option (first column).
Now I realize that GIOB_2 is greyed and you cannot select another option without getting a conflict reported for this row.
I don't know if that's a bug in HalCoGen or something in your DIL file. I have seen this sort of issue before though when trying to use a DIL file created originally for one variant of a device on another; because the way that the DIL stores the config information is by 'row' in the pinmux table and that table might have extra rows for say a 1227 versus a 1224. I don't know if you did that or not.
Try temporarily changing the line to
pinMuxReg->PINMMR9 = ((~(pinMuxReg->PINMMR9 >> 18U) & 0x00000001U ) << 18U) | PINMUX_PIN_54_HET1_31 | PINMUX_PIN_55_GIOB_2;
I looked into this a bit and it seems that the control on that line is disabled by the HalCoGen XML file from selecting GIOB_2 for pin 55 so not sure whether this is a mistake or not but I suspect that configuring as a MibSPI chip select which you have set to output high in HalCoGen (as GIO) is causing a problem.). Only thing I don't understand is why output high causes the voltage to be low; unless somewhere else in your code you flipped the state of the MibSPI chip select...
Yes i'm going to file a ticket on HalCoGen because it looks like this is an issue in one of the xml files that prevents you from clicking the GIOB_2 option on pin 55.
But basically - you found another way to configure that pin and now your issue w. drive level is gone, correct?
EDIT: Ticket is SDOCM00122780