Shop OBEX P1 Docs P2 Docs Learn Events
Is I2C & 2 wire communication for sensirion temperature/humidity sensor - Page 3 — Parallax Forums

Is I2C & 2 wire communication for sensirion temperature/humidity sensor

13»

Comments

  • CreeCree Posts: 132
    edited 2013-07-02 10:41
    It turned out to pretty simple adjustment to the code that I have, I just made CC0 be as shown below and I integrated it into the display

    CC0             DATA    LcdCC0, $0C, $12, $12, $0C, $00, $00, $00, $00
    

    Thx for the help.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-07-02 13:46
    You should use the code tags instead of quote to paste code. Also, for future reference when posting code that won't compile, most of the time you can't verify the problem without the entire program, so in that case you should attach it so the original can be downloaded and loaded in. However at first glance I see you're using two keywords (reserved words) to evaluate a conditional.
    [COLOR=#333333][FONT=Arial]IF PIN 17 = HIGH THEN[/FONT][/COLOR]
    

    Should read:
    [COLOR=#333333][FONT=Arial]IF IN17 = 1 THEN[/FONT][/COLOR]
    

    PIN and HIGH are not meant to be used in this manner.
  • CreeCree Posts: 132
    edited 2013-07-03 08:21
    You should use the code tags instead of quote to paste code. Also, for future reference when posting code that won't compile, most of the time you can't verify the problem without the entire program, so in that case you should attach it so the original can be downloaded and loaded in. However at first glance I see you're using two keywords (reserved words) to evaluate a conditional.
    [COLOR=#333333][FONT=Arial]IF PIN 17 = HIGH THEN[/FONT][/COLOR]
    

    Should read:
    [COLOR=#333333][FONT=Arial]IF IN17 = 1 THEN[/FONT][/COLOR]
    

    PIN and HIGH are not meant to be used in this manner.

    ok I will keep that in mind.
  • CreeCree Posts: 132
    edited 2013-07-04 08:31
    Im trying to use two BS2sx together to send information from one to the other. I have one on the NX-1000 basic works development board and the other on a basic stamp carrier board.

    I tried using the serout example found in the basic stamp help, it does not work and the basic stamp gets a bit warm. I also using a 9 volt battery on the carrier board.

    I wired it as in the picture given, but I am unsure what the problem is.

    Can someone give me some insight on what may be the issue.
  • Mike GreenMike Green Posts: 23,101
    edited 2013-07-04 08:54
    When you ask questions like this, you really have to furnish a schematic showing how you have everything connected. This has to be derived from your actual wiring, not what you think you have. It's impossible to provide much insight without more information. Maybe there's a short circuit somewhere on one of the boards, maybe a mistake in the wiring. Normally a Stamp doesn't draw much current unless you have it connected to other devices like LEDs for example which could draw several tens of milliAmps each depending on what you're using for a series resistor. The Stamp's built-in regulator has to dissipate anything over 5V as heat ((9V - 5V = 4V) * (whatever current is drawn)) and that can heat up the Stamp. You're just talking about a SEROUT example which shouldn't involve much current, so that doesn't explain the heat and there must be something else going on that you're not giving enough information to determine.
  • CreeCree Posts: 132
    edited 2013-07-04 10:21
    Mike Green wrote: »
    When you ask questions like this, you really have to furnish a schematic showing how you have everything connected. This has to be derived from your actual wiring, not what you think you have. It's impossible to provide much insight without more information. Maybe there's a short circuit somewhere on one of the boards, maybe a mistake in the wiring. Normally a Stamp doesn't draw much current unless you have it connected to other devices like LEDs for example which could draw several tens of milliAmps each depending on what you're using for a series resistor. The Stamp's built-in regulator has to dissipate anything over 5V as heat ((9V - 5V = 4V) * (whatever current is drawn)) and that can heat up the Stamp. You're just talking about a SEROUT example which shouldn't involve much current, so that doesn't explain the heat and there must be something else going on that you're not giving enough information to determine.


    The only possible issue that I can see is that I am using the GND from the NX-1000 board instead of directly from one of the VSS pins on the controller.
  • Mike GreenMike Green Posts: 23,101
    edited 2013-07-04 10:47
    The examples given in the various manuals, documentation, and tutorials from Parallax are all tested before publishing. There have been rare errors over the years, but these are very few and usually caught promptly. Similarly, it's very rare to find a hardware problem with Parallax's microcontrollers or boards unless there's been an accident or abuse. When someone complains about one of these examples not working, it's almost always due to a wiring error or a mistake copying code. Sometimes there have been problems with a broken wire or a worn out breadboard contact. As mentioned earlier, how warm a Stamp module gets depends on what Vin is being used and what's connected to the Stamp that may be drawing current. Some warmth may be very normal. Usually "too hot to touch" is due to a short circuit somewhere. It all depends on the details.

    There's not a lot of difference between the GND connection on the NX-1000 board and the Vss pin on the Stamp plugged into the board other than a few inches. That shouldn't make any difference unless the Stamp's socket is worn out (not likely). The Stamps are just not fast enough for this sort of thing to make much of a difference except in very unusual circumstances (controlling RF circuitry or sensing low voltages for example).

    This may seem pedantic, but is useful to restate for others who have similar problems ...

    The question at the heart of this sort of thing is "how do I figure out why it doesn't work the way I expected? How do I fix it?"

    There are two ways to approach this. One is to say "I didn't do anything wrong. I copied the circuit the way it was written in the documentation. I copied the code from the manual. There must be something wrong with the original code or my board or whatever". The other is to say "This isn't behaving the way it's described. What's different between what's written in the book and what's laying here before me on my workbench? There must be a difference because there's a difference in the behavior". First you have to pretend to be someone else ... not the person who laid out the wiring and who entered the code ... and compare what's on the computer screen and workbench with what's in the documentation and note any differences. If you can actually get someone else to look over your work, so much the better. You note unexpected behavior (as you did with the apparent temperature of the Stamp). If you can, make simpler tests first, like using an LED or logic analyzer or multimeter to monitor the signal lines between the two Stamps and use one Stamp to toggle the signal line so you can see if that's working first, then try it the other way. Step-wise you check things out making sure that your assumptions are true before proceeding to the next step. Insert debugging code where you can ... obviously the debugging code can't slow things down too much if the sample code is time-dependent. This is where some instruments can be handy. The Propeller, by having some free cogs (processors), can use some of them for debugging without affecting existing code.
  • CreeCree Posts: 132
    edited 2013-07-04 11:15
    I put a message in the output program that should get a message in debug saying 'sent' after the hello message is sent to the other stamp, but it seems that it does not complete the job.
    ' {$STAMP BS2sx}  ' SERIN_SEROUT1.BS2
    ' Using two BS2-IC's, connect the circuit shown in the SERIN command
    ' description and run this program on the BASIC Stamp designated as the
    ' Sender. This program demonstrates the use of Flow Control (FPin).
    ' Without flow control, the sender would transmit the whole word "Hello!"
    ' in about 1.5 ms. The receiver would catch the first byte at most; by the
    ' time it got back from the first 1-second PAUSE, the rest of the data
    ' would be long gone. With flow control, communication is flawless since
    ' the sender waits for the receiver to catch up.
    
    
    
    
    ' {$PBASIC 2.5}
    
    
    SO              PIN     1               ' serial output
    FC              PIN     0               ' flow control pin
    
    
    #SELECT $STAMP
      #CASE BS2, BS2E, BS2PE
        T1200       CON     813
        T2400       CON     396
        T9600       CON     84
        T19K2       CON     32
        T38K4       CON     6
      #CASE BS2SX, BS2P
        T1200       CON     2063
        T2400       CON     1021
        T9600       CON     240
        T19K2       CON     110
        T38K4       CON     45
      #CASE BS2PX
        T1200       CON     3313
        T2400       CON     1646
        T9600       CON     396
        T19K2       CON     188
        T38K4       CON     84
    #ENDSELECT
    
    
    Inverted        CON     $4000
    Open            CON     $8000
    Baud            CON     T38K4 + Inverted
    
    
    
    
    Main:
      DO
      DEBUG "send",CR
        SEROUT SO\FC, Baud, ["Hello!", CR]  ' send the greeting
      DEBUG "sent",CR
        PAUSE 2500                          ' wait 2.5 seconds
      LOOP                                 ' repeat forever
      END
    
    
    ' SERIN_SEROUT2.BS2
    
    
    
  • Mike GreenMike Green Posts: 23,101
    edited 2013-07-04 11:35
    You need to provide more information ... like a schematic or complete connection description.

    Your SEROUT statement uses flow control. It won't send the data unless the FC pin is high (since you specified Inverted mode). Also note that the Stamps don't do a good job of timing with the higher Bauds (like 38.4KB) and they won't reliably receive anything above 19.2KB. The BS2sx and BS2px are faster and do better with this, but you shouldn't normally expect a Stamp to send faster than 19.2KB or receive faster than 9600 Baud. A lot depends on the details of the SEROUT or SERIN statement used. See EMESystems' website for details on timing.
  • CreeCree Posts: 132
    edited 2013-07-05 06:41
    I found the issue with the circuit, it is a short circuit as u mentioned as one of the possible issues. I'm testing it to see what is causing the problem.

    It is being caused by the carrier board.

    Right now I have 5V of the NX- 1000 going to Vin of the board, the two VSS of thecarrier board to the GND of the NX-1000. That is the only area I can think of causing the problem.
  • Mike GreenMike Green Posts: 23,101
    edited 2013-07-05 08:17
    It's usually not a good idea to use +5v as Vin. There's a regulator on the Stamp module that takes Vin and normally produces +5V for use on the module. It's a low dropout regulator, so, with a 5V input, the output will be in the neighborhood of 4.0V to 4.4V which is quite marginal and may not even work. You can feed +5V directly to the Vdd pin and not use Vin bypassing the regulator or you should use a higher Vin, something like 6V to 7.5V.
  • CreeCree Posts: 132
    edited 2013-07-05 08:41
    Well its not the 5V that is the issue. I believe its has to do with the two VSS pins that go to the GND of the NX-1000, but doesn't make sense why there is a short.
  • CreeCree Posts: 132
    edited 2013-07-05 12:16
    I have come to the conclusion that one of the BS2sx is burnt. (the one on the carrier board), so ill need to get another one.
  • CreeCree Posts: 132
    edited 2013-07-09 10:37
    K I got a new BS2sx. But,

    For some reason, when I connect only the 5 V to VDD and the vss of each controller together, it creates a short of a few MVs.
  • CreeCree Posts: 132
    edited 2013-07-10 06:34
    I suppose no one has an answer to my issue.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-07-10 12:44
    I have no clear picture of what your issue is. I'll hazard a guess though, that you have something wired up wrong.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-07-10 14:48
    I'll weigh in too that I still haven't seen any wiring diagram or schematics posted of your connections even though Mike has asked you to post them. As Tracy said, without knowing exactly how you have everything wired we can only assume there is an error in your connections.
  • ClaiudiuClaiudiu Posts: 13
    edited 2013-07-16 06:17
    I used sht15 for controlling temperature from a room. you can check it out here.
    http://youtu.be/imJc_reASCE but don`t forget to turn captions on. i speak Romanian so i made subtitles for you guys.
    Thumbs up :smile:
Sign In or Register to comment.