Announcement

Collapse
No announcement yet.

1-Wire-TEMP.inc Isn't working properly

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 1-Wire-TEMP.inc Isn't working properly

    Hello, I've recently gotten my hands on some temperature sensors (DS18B20) and wanted to try using them in conjunction with my Diablo16 Touch display ( gen4-uLCD-43DCT-CLB ), i looked through your app notes and found a project that should work, at least as far as I can see. ( Visi 1-Wire demo / 4D-AN-00070 ).

    However when I attempt to compile the project, after making the necessary adjustments to fit my display, instead of the display used in the example, I get errors from the 1-Wire-TEMP.inc library file, telling me that functions OW_Read, OW_Write and OW_Reset are already in use as PmmC functions.

    I tried getting around this by simply adding a 1 to each function name in the library and in the project file, but then it complained about pin_Set(OUTPUT, OW_PIN); (and the input equivalent), giving me an error saying
    " Error: 'OUTPUT' not found (line 82 file:1-Wire-TEMP.inc) "
    I tried changing the modes (OUTPUT / INPUT) to what the IDE tells me they should be (OUT / INP), however the problem persists.

  • #2
    Hello,

    The application note that you refer (Visi 1-Wire demo / 4D-AN-00070) uses the PICASO display.

    The command for setting the pins on PICASO are as follows:
    Code:
    pin_Set(OUTPUT, OW_PIN);

    whereas in the DIABLO processor this command is used:
    Code:
    pin_Set(PIN_OUT,OW_PIN);
    The 'OUTPUT' and 'PIN_OUT' are the terms used for the output pins.

    Also, please take note of the pin assignment used in PICASO.

    You can replace the 'IO5' with the 'PA12', so your pin declaration should be like this:
    Code:
    #constant OW_PIN PA12       // define pin for 1-Wire

    Attached is the picture of gen4-PA pin assignments for PICASO and DIABLO16 processors.
    Click image for larger version

Name:	gen4-PA.png
Views:	76
Size:	197.0 KB
ID:	67830
    For more information, you also check the Internal Functions for both DIABLO16 and PICASO.

    Best Regards,
    Kevin

    Comment


    • #3
      Thank you very much, i've gotten it to compile and download to my display now.

      However it seems that the program gets stuck somewhere, after talking to the DS18B20 temperature sensor and getting its serial number, the display gets stuck on just showing the serial number and "I AM A MASTER DEVICE" part of the program, I've been looking through it, but can't seem to find a reason it would get stuck. Any help would be much appreciated.

      Comment


      • #4
        Hi,

        I assume that the widgets on the project are not loaded on the display.

        Upon checking the project, the files you are loading from the display ('.dat' and '.gci') are different from what the Workshop4 has generated on the memory card.

        Replace this line of code:
        Code:
        hndl := file_LoadImageControl("1-WIRE~3.dat", "1-WIRE~3.gci", 1);
        with this

        Code:
          hndl := file_LoadImageControl("1-WIRE-D.dat", "1-WIRE-D.gci", 1);
        If the hardware is configured correctly, you should be able to run the program without a problem.

        Best Regards,
        Kevin

        Comment


        • #5
          Thank you very much, can't believe i didn't see that myself

          Everything Works as it should now.

          Comment


          • #6
            Hi,

            I am glad that it helps. Should you have any concerns, please don't hesitate to ask.

            Best Regards,
            Kevin

            Comment

            Working...
            X