Jump to content
  • 0

PMOD TMP2 on a Zedboard


bit5huang

Question

23 answers to this question

Recommended Posts

Hi @bit5huang,

You could add a gpio block to your block design in vivado. Set the output to custom with one as the width. After you re-make the wrapper you will use the pin assigned to the gpio to be constrain in the xdc. Then in the SDK you compare the temp to a value. If the value is a specific number or higher send a 1 out the gpio pin.

thank you,

Jon

Link to comment
Share on other sites

Hi @bit5huang,

As it turns out I do not have a genesys 2 or the appropriate license to set up a project using the Pmod TMP3. I will have a co-worker that does have the genesys 2 and appropriate license do this. Unfortunately, they are out for the next couple days. When they are back in the office I will have them look into this for you. Also I would try using the Getting Started with Microblaze tutorial. On step 5 also add the Pmod TMP3 to the project. The rest of the vivado portion of the tutorial should be the same. Then in the SDK make an empty Application and add the main.c like you have done above. Let us know if this resolves your issue. I looked up this error and I believe this is because you have the reset set to the wrong logic level. If reset is currently active high set it to be active low. Here is a xilinx forum thread that talks about this.

cheers,

Jon

Link to comment
Share on other sites

Hi @jpeyron

Based on your suggestion, I edited the IP core and successfully generated the bitstreams. After importing it into the SDK, I created an empty project, created a <main.c> in the SRC, added the program to TMP3 , After the completion of <program FPGA>, in the debug, there have been problems as shown. I do not know where is the problem, please give me a suggestion, yesterday you said you want to ve rify that ,of course,if you succeed, you can attach a reply.

 

Thanks!

微信截图_20180109190145.png

微信截图_20180109195718.png

Link to comment
Share on other sites

Hi @jpeyron

Thank you for your guidance, I have successfully used Zedboard to collect the temperature information on PmodTMP3. Sorry for the inconvenience, and now that I have a new problem with <Genesys2>, I try to communicate with PmodTMP3 with <Genesys2>, reference HERE. Then I get an error and can not complete <Implementation>, then attach my BLOCK DESIGN, hope you can answer me how I design, and how to achieve with <Genesys2> to complete the acquisition of PmodTMP3 temperature.

 

Thank you!

微信截图_20180108165506.png

微信截图_20180108165344.png

Link to comment
Share on other sites

Hi@jpeyron

I can confirm that I use the IP core and procedures are from here, I have not changed. I use the latest IP core, and in the SDK to create a blank project, copy the <main.c>, then DEBUG AS. Whether in VIVADO2015.4 or VIVADO2017.2, I got the result in this picture .This is exactly why I am distressed. If possible, after your test is successful, hope you can provide some details of the considerations, as well as your use of <main.c> and so on.
I wish you a Happy New Year, looking forward to your good news.

 

CHEERS

微信截图_20171228204435.png

Link to comment
Share on other sites

Hi @bit5huang,

Thank you for clarifying that you now have a Pmod TMP3. I was still under the impression that you where still trying to modify the Pmod TMP3 IP core to work with the Pmod TMP2.  I would suggest to start a new project with a Pmod TMP3 IP core that you have not changed or ran in another project.  I would make sure that you have gone though Getting Started with Digilent Pmod IPs. Are you experiencing the same issues still? I am not near a zedboard or a Pmod TMP3 today. I will test the Pmod TPM3 IP core with the Zedboard on Tuesday after the new years holiday. If I have no issues I will link my project here for you to use  and compare your project to. 

thank you,

Jon

Link to comment
Share on other sites

All the programs I use and the IP cores come from here     and this photo shows where i kept calling the TMP3_ReadIIC function in the <PmodTMP3.c>. Then  can you show me where is   the  bit 7 (RDY#) ? I had  not even seen this bit.  And show me where and how to Modify the code . 

微信图片_20171229113406.png

Link to comment
Share on other sites

Hi @bit5huang,

Can you show me where you kept calling the TMP3_ReadIIC function in a loop reading the status register waiting for the  bit 7 (RDY#) to go low. When the bit 7 (RDY#) goes low then call TMP3_ReadIIC(&myDevice, 0x00, buffer, 2) to capture registers 0x00 & 0x01 (temperature data). Is this in your TMP3_getTemp function? If so please link code that does this.

cheers,

Jon

Link to comment
Share on other sites

Hi@jpeyron

I got the PMODTMP3 module and connected it to ZEDBOARD, built BLOCK with the TMP IP core, generated the BIT streams, imported it into the SDK, built an empty project, and created a< main.c>, no matter which version I used The procedure, the surrounding temperature varies greatly, its final result is like this.I hope you can tell me why, what should I do.

Thanks.

 

微信截图_20171228204435.png

1514465229(1).jpg

微信截图_20171228204759.png

main.c

main.c

Link to comment
Share on other sites

Hi @bit5huang,

You should not be altering the TMP3_ReadIIC function but rather kept calling the TMP3_ReadIIC function in a loop reading the status register waiting for the  bit 7 (RDY#) to go low. When the bit 7 (RDY#) goes low then call TMP3_ReadIIC(&myDevice, 0x00, buffer, 2) to capture registers 0x00 & 0x01 (temperature data). Then print the temperature date.

cheers,

Jon

Link to comment
Share on other sites

Hi @bit5huang,

I am attaching some pseudo code for how to get the Pmod TMP2 working. For reference I would look at the datasheets TMP3 and TMP2 as well as the arduino code TMP3 and TMP2. I would also suggest to look at our other IP cores as reference. Unfortunately, we do not have the time to make a working IP for the Pmod TMP2 currently. We will make an IP core for the Pmod TMP2 but we can not give an ETA. I am sorry for the inconvenience this may cause.

thank you,

Jon 

tmp2-pseudo.txt

Link to comment
Share on other sites

Hi@artvvb

very sorry for disturbing you,by trying your method above  of usting the TMP3_begin, TMP3_IICInit, TMP3_ReadIIC, and TMP3_WriteIIC  functions with  pmodtmp2 and  Zedboard,Perhaps because my level is not enough and  Not well understood I could not use these functions,I failed much times in the SDK.So i hope you can write A few lines of code of the ADT7420  of the TMP2 to help me get temperature information using  the Zedboard.

Thanks.

Link to comment
Share on other sites

@bit5huang

We currently do not have a Pmod IP core for the TMP2. I would suggest that you use the TMP3 IP core to get an I2C connection going. From the TMP3 drivers, only the TMP3_begin, TMP3_IICInit, TMP3_ReadIIC, and TMP3_WriteIIC functions should be used, as these interact directly with a generic IIC controller. From there, review the ADT7420 data sheet to determine the correct way to configure the device and grab data. Page 13 of this data sheet contains the register map of the device, of these registers, the most important will be the temperature registers (0x00,0x01) and the status (0x02) and config (0x03) registers. Reading the higher-level functions of the TMP3 drivers might give you a decent idea of how to use the Read/WriteIIC functions.

Using the TMP3 IP will not give you access to the interrupt pin, so I would recommend that you set the configuration register to 1-sample-per-second mode, then continuously poll the status register to see if a sample is available to be read. When the RDY bit of the status register goes low, take a reading from the temperature registers and printf it out over the UART connection to the Zedboard.

Apologies that this isn't exactly plug-and-play, hopefully this should be enough to get you started...

Thanks,

Arthur

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...