1-wire DQPin Pin assignment

stomasikstomasik Posts: 3
edited 2010-10-24 - 02:31:32 in Microcontrollers
Is there a way to map the DQPin in the SXB 1-wire commands to a different I/O pin during program execution? For instance change it from RC.1 to RC.2 to RC.3 and then when finished change it back again? I have three temperature sensors I need to access but do not want to deal with the serial number search. I can access them with three different subroutines for each device but it consumes quite a bit of the memory.

Thanks,

Steve

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-10-22 - 08:27:02
    As I understand it, you want to have three 1-wire sensors individually tied to separate i/o pins. It should work quite well. You just have to be sure the software has completed its task before changing to another device on another pin.

    This would eliminate both the need to use addresses to reach individual devices and problems created by having multiple devices on one line.

    But the serial number with a CRC is still quite useful to determine that the individual lines are providing good data and that bits are not being dropped out. You need to post your code to have it cleaned up. I don't quite see why you need three different subroutines to do this when you can likely have one subroutine called with the different parameters.
    Hwang Xian Shen, Puddleby-on-the-Marsh.
    All things considered, I can live and thrive without Microsoft products. LINUX is just fine.
  • BeanBean Posts: 8,027
    edited 2010-10-22 - 10:37:40
    No, the DQpin must be a constant.

    Bean
  • stomasikstomasik Posts: 3
    edited 2010-10-22 - 18:09:44
    LB- I have uploaded my code. If you have some ideas let me know.
    Thanks for your replay.

    Bean- I was afraid you were going to say that. I was hoping there was a crafty way I could force a bit in memory or something. The code I uploaded works fine the way it is but there is not much program memory left and I want to have enough space for initializing a RF transceiver module. I think I am going to use the Hope RMF12. I am still studying the documentation so I don’t know how much program memory I will need yet. I was also thinking of adding a switch something like a CD4066 and just switch the temp sensors in and out of the DQPin as needed. That would free up quite a bit of memory.

    Thanks,

    Steve
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-10-24 - 02:31:32
    Ooops... I guess this is an SX/B compiler limitation. In theory, the SXes would do this in SXASM. It might be worth adapting the SX/B to SXASM code.
    Hwang Xian Shen, Puddleby-on-the-Marsh.
    All things considered, I can live and thrive without Microsoft products. LINUX is just fine.
Sign In or Register to comment.