Here I am uploading a custom component to read temperatures from Maxim DS18B20 digital temperature sensors. It implements 1-Wire communication to read sensor temperature at 12bit resolution , simultaneously samples data from up to 8 sensors, returns temperature in float, integer and string formats.
Attached archive contains component library, component datasheet, two demo projects and screenshots. Tested on PSoC4200 (PioneerBoard) and PSoC5LP (FreeSoC) under Creator 3.1 SP1
Solved! Go to Solution.
The demo programs are missing the KEES librarys for the Psoc Pioneer board and the Psoc 420 board and gives the folowing errors The instance 'PSoC_4_Pioneer_Kit_1', of component PSoC_4_Pioneer_Kit, contains an error. Unable to locate and customize component 'PSoC_4_Pioneer_Kit' used in schematic 'C:\Users\Bob\Documents\Cypress Projects\one_wire\Demo1\DS18x8_demo.cydsn\TopDesign\TopDesign.cysch'. and Unable to find dependency 'KEES_Library' at 'C:\Program Files (x86)\Cypress\Component libraries\KEES_Library.cylib\KEES_Library.cyprj'. Please verify your project dependencies are correct.. Where can these updated library's be found? I have tried the one's in the 100 projects in 100 days in PSOC 3.0 and have hot rried them in the PSOC 3.0 and have not tried them in PSOC 3.1 SP2. Also they do not contain the PSOC 4200 board.
The project page PioneerBoard_IMG has wiring diagram attached as an image file, so one can see PioneerBoard arrangements without having KEES library installed. Simply delete the PioneerBoard page which gives errors , it has nothing else but explanation of external wiring.
The DS18x8 component itself does not use KEES library. I will update demo project by removing link to this library. I can't remember where from it came, I searched Cypress website, but can't locate one specifically covering PioneerBoard drawing primitive. Can anyone help us to locate it?
I have successfully used odissey1's DS18B20 1-wire component and found it well-documented and easy to use. However, I would also like to use the DS18B20 in a project that requires nearly all of the UDBs for other functions, not leaving enough for the status and control registers of the DS18B02 component. Does anyone know of a PSoC 4 BLE compatible 1-wire component or library that either bit-bangs a GPIO or uses one of the Serial Comm Blocks? If not, I'd welcome any tips to start to roll my own.
I found the website below, which itself references the Maxim datasheet on how to use a UART as a 1-wire master. I'm thinking that, by using the bidirectional digital pins of the PSoC, I wouldn't need the external two-transistor circuit shown.
Nain: You had some issues with your program and your output to the LCD was incorrect and was flagged by Psoc Creator I changed it to LCD_printString and it seems to work. Also what version of PSOC Creator are you running. I didn't up-grade it to the latest version as I didn't want you to have issues with opening it. Also the Maxim chip will provide the answer in Deg C or Deg F you just have to read the correct Memory location. You can also convert it with some math °C x 9/5 + 32 = °F or (°F - 32) x 5/9 = °C. I don't have the DS18B20 device to try it so I was not able to read any real data. Also there is a char LCD library that allows you to use any pin on any port so you don't have to loose so many pins in a row.
I am using the DS18B20 sensor (only 1 sensor) with your ds18x8 component and I am experiencing some problems (both with psoc 3 and 5). The problem overall is that the sensor is not communicating, both in parasite and normal mode. In parasite in particular I am connecting both GND and VDD to the mass of my psoc and the DQ to a bidirectional digital pin (open drain drives high, initial state high). I tried two configurations: DQ directly to psoc's pin and Dq to pisoc and in parallel to VDD through a 4K resistor; both are not working. (actually in a case psoc 3 had 15.9365 as fixed output, but I have changed the code and can't come back to that window)
My code's flow is something like this (I jot it down as pseudocode):
-Start DS component();
-send temperature request
-if data is ready then read temperature
-get the temperature thru gettemperatureasfloat and use sprint f to put it into a string
-use the USBUART module of the psoc to send the data to the PC
The output is always -256.00 !
Could you help finding the error?
Thanks for your reply.
Actually the problem was on the pin input setting, now everything is working properly. Thanks for the component so well written and explained.
how i can import new component?? i use psoc 3.1 sp3. help me, please. i started with CY8CKIT-059 PSoC 5LP
In Creator with your project opened: select in Workspace explorer window the Components Tab.
Then click right on Project and select Import Component.
See instructions video
Thanks also for this OneWire component and great forum example projects!
OneWire works without any problems on CY8CKIT-049-42XX. I have moved this component into a similar project and used the serial port only. The Cypress 'tidbit' was included for resetting the 049 board, using SW1 to place the board into bootloader mode, after SW1 is pressed for 2 sec.
I just started this, I don't have the files in the "generated source" folder, where can I get them?
I am not sure what the question about. The "Generated source" folder should not be of any concern.
To add component to the project, please (1) download the library DS18x8.cylib.zip from the previous post and unzip it in any folder of your choice. (2) Open your project (or the demo project provided with the library). (3) follow this 1-minute video tutorial on how to add the library to the project (Project->Dependencies->Add...).
I don't know if you are still monitoring this item, but I have a problem that perhaps you can help with.
Usine a CY8CKIT-059 - trying to interface with a DS18B20 using component 18x8
I've imported the 18x8 component from the project you posted and moved the *.c and *.h files to their appropriate folders. I have set the component's number of sensors to '1' and tried to build. The compile fails and says that the netting is looking for 8 inputs but there is only 1 connected.
the error says the 'fitter' failed because "sdb.M0024 - pin_1.io_0 with width=1 connecting to net_80[7:0] with width=8" and it says this needs to be changed.
How do I fix this? I tried setting back to '8' and just connecting 1 input but that didn't work. I looked at the .c and .h files to see if this is a setting in code but I don't see anything that suggests it might be the culprit.
Can you help?
Based on your description I am a bit concerned how the component was imported into the project. Importing a component does not require adding *.c or *.h files (all is handled automatically by the Creator). Also, the component was provided as a library, which can be used without explicitly importing the component to the project.
The easiest way is to start with ready-to use project DS18x8_demo1.cyprj from thread #20 (above). The project already has DS18B20 component imported, you may further modify project for your needs.
Second option to import component from another project:
The DS18B20 component is also available as a stand-alone library (DS18x8.cylib, see #20 above), which does not require importing component into the project. This is standard way of using components. Please follow the steps to add library into your project:
1. Unzip library DS18x8.cylib.zip in the folder of your choice.
2. In Creator: Project -> Dependencies->User dependencies->New entry (folder icon) browse to the just unzipped library folder and open DS18x8.cyprj.
3. Done! Now DS18x8 component appears in Components panel (Default)
See demonstration here:
Yes, I can see how my steps would be confusing. When I began working on this I had tried importing the DS18x8 component into my own project from one of the bundled projects higher up the reply chain, and when the compile problem presented itself I tried bringing in the .c and .h files to see if that would correct it.
So thanks for pointing out the library, that is really the way to go I think. I'll remove my previous attempts at doing this and import that library using the procedure you graciously listed out and.I'll let you know how it all comes out.
Oops! Problems with compiling with the library attached. It complains about versions.
I'm using PSOC creator 4.2 and the target is a CY8CKIT-059. All components are updated as of 10 minutes ago. Library import went smoothly just as you described but the build fails.
The project in post #20 was compiled with Creator 4.0. I will test it with Creator 4.2 in the evening. Should work.
I pulled in both the copy of the library you sent as well as the project you supplied.
The project compiled but gave me warnings about my clock tolerance, no biggie.
I then went to my project and imported 18x8 in from the demo you sent. The errors changed a bit. I compared settings for the component and the pin I'm using and they match.
Here are the errors. Again, board CY8CKIT-059, Creator 4.22. Using I2C and a UART for other functions.
Appreciate your help.
I believe that the difference in the Pin_1 settings. Please copy/paste Pin from the original project supplied above. Else you can post your project for review here: (1) Click project name in Creator's Project Explorer panel; (2) File->Create workspace bundle->minimal, (3) Inside created archive please delete "Generated_source" folder to reduce archive size.
Hello, Is it possible to read 8 DS18B20 sensors on one bi-directional pin? I am not very good at programming and it is necessary for further research. Can you help me with the software? I tried but unfortunately I can not understand it .. I'm using PSOC creator 4.2 and the target is a CY8CKIT-059. On eight pins, the previous example works but this is not the purpose of my further research ... I need to have communication using one pin ... I would be extremely grateful for the help I received.
DS18B20 has an option to connect multiple sensors on a single communication wire, but DS18x8 component does not support that feature. It was originally developed to monitor electronic equipment in the environmental chamber, where thermal conditions had to be sampled simultaneously troughout the system under test.
Did you run out of pins on the KIT-059 or there is some particular reason to use a single pin only? Can you simply switch to a kit with a larger pins count, e.g. Sparkfuns' FreeSoC2?
Thank you for your comprehensive response. Ok Why I understand why this item does not work on a single pin... Yes, the reason is that I need to do any research for my work using these sensors and I have imposed that it must be a network connected by one bidirectional pin. Communication is done in this way. I have the task to do the rest of the test, as the different wiring arrangement on the sensors or their topologies, the execution of various types of measurements, times, etc. But I can not set the program that these sensors work on one network and I do not have anyone who could help me in this.... Unfortunately I'm not a programmer and not too much on this so well I know to convert. From what I read it I understand that the proper order of reading them, saving and sending the appropriate commands must be implemented. My programming skill, however, is not so good that I remade it.
I would be immensely grateful for your help in this matter. Without this, I cannot proceed further to any further research.
Communicating to multiple 1-Wire devices on a single line is rather cumbersome. I won't be able to help you at this time. For a detailed explanation please refer to the Book of iButton Standards:
thank you for your willingness.
I have already read this note. As I wrote earlier, I understand that it is necessary to set the reading, reset, bus readiness, etc., but I can not implement it in the program ... Although it seems very simple for others.