Shop OBEX P1 Docs P2 Docs Learn Events
SDA/SCL Pullups — Parallax Forums

SDA/SCL Pullups

NewzedNewzed Posts: 2,503
edited 2007-11-04 23:25 in Propeller 1
I'm building a new EEPROM board and I want to use SMD resistors.· I thought I had some 10K but all I have is 4.7K.· Is 4.7K too strong a pullup for the SDA/SCL pins?

Sid

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.

That is why they call it the present.

Don't have VGA?
Newzed@aol.com
·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-31 13:52
    Sid,
    According to an application note on Maxim's website, anything over 1K should be fine for I2C. There is a difference between I2C and SMB which is a similar bus. SMB expects higher values (like 10K). The main advantage of using something higher than 4.7K would be if you're going to run your system off batteries. In that case, a 1/2mA extra drain can add up.
  • NewzedNewzed Posts: 2,503
    edited 2007-10-31 13:58
    Thanks, Mike.· I have another place to look for the 10K - maybe I'll get lucky.· Another question off-topic.· If somehow I am able to start a new cog, which I haven't been able to do yet, and that cog has a method that started something, could I call that method from my top file, or once a cog is started does it run continuously?

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-31 19:05
    @Newzed. Your question makes not much sense - so I quite understand that you have not yet managed to "start a new COG" as you put it.

    Look: You can either:
    - start a new Cog cog containing machine code from the DAT section. ThatCOG would run forwever until "stopped", starting at address zero. There are no "objects" with that concept.

    or:
    - start a new COG with a SPIN interpreter. You use a different syntax with the COGNEW for this. This COG will be active as long as the called method takes. There is also no "object" with this concept.

    Post Edited (deSilva) : 11/1/2007 1:29:55 AM GMT
  • NewzedNewzed Posts: 2,503
    edited 2007-10-31 20:39
    deSilva,·if a new cog can not have its own object, can it use the bs2_functions object in my top file.· I wanted the new cog to use a "·bs.pwm....... " command to·turn on a· Nichia RGB chip.· PWMing is essential if I want more than three colors.

    Sid·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • deSilvadeSilva Posts: 2,967
    edited 2007-11-01 01:35
    A process running within a COG, be it an assembly program or a copy of the SPiN interpreter looking after some SPIN routine - has nothing to do with objects - generally....

    However: You cannot parametrize COGNEW with a method from another object - which is a well known bug and not a feature smile.gif So library objects contain a START routine, not only for convenience and encapsulation.

    When you want an independant COG to run a (SPIN) routine in another object, you have to wrap it into another routine in your local object.
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-11-01 04:56
    Sid,
    You should be able to start another cog using BS2_Functions similar to the following (top of head code) using the new functions code I know you downloaded:
    Obj
      BS2 : "BS2_Functions"
     
    VAR
      stack[noparse][[/noparse]50]
     
    Pub Start
      cognew(PWM22,@stack)
      Bs2.PWM_Set(2, 500, 10)  ' run 1st PWM, variable would probably be used
      Repeat
     
    Pub PWM2
      Bs2.PWM_Set(3, 250, 10)  ' run 2nd PWM, variable would probably be used
      Repeat  
    
     
    

    -Martin

    PS: Sid, I·used one of your posted PCB's for the VGA connector.· Do you have a good source for a 15-pin female?· I can't find it at digikey, just the male.
    ·
  • NewzedNewzed Posts: 2,503
    edited 2007-11-01 12:12
    Martin, the Digikey part number is 180-15FE.· If you ever want to use the connector with the DB15 over two PS/2 connectors, I have that part number, plus an Expresspcb footprint.

    I'll take a look at your [url=mailto:BS@.PWM]BS2.PWM[/url] stuff.· I need the PWM to run while the Prop is doing something else,and then I need to stop it.· The PWM starts when the Prop runs a certain task, then when the Prop finishes the task, the PWM stops.· I'll see what I can work out.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • NewzedNewzed Posts: 2,503
    edited 2007-11-01 12:29
    Martin, is the stack[noparse][[/noparse]50] VAR bytes, words or longs?

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-11-01 12:34
    Sid,
    Thanks for the part number. Long... I just pulled a number out my.... you know.

    -Martin
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-11-01 12:36
    Ah, so that wasn't a right-angle version for the DB-15. Hmmm, thanks.

    -Martin
  • NewzedNewzed Posts: 2,503
    edited 2007-11-01 13:15
    Martin, if you want the right angle connector, the part number is A32075.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-11-01 13:22
    Thanks Sid,
    I just couldn't find it. Let me know if the code helps you do what you want.

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    StampPlot - GUI and Plotting Software
    Southern Illinois University Carbondale, Electronic Systems Technologies
  • NewzedNewzed Posts: 2,503
    edited 2007-11-01 14:06
    Martin, let me explain exactly what I want to do. I have a routine called "Get Time".

    (case statement)

    "G":

    print(cls)
    print(blu)
    bblu ‘when I call this routine I want to start PWMing the blue LED
    senddata("Y") 'WAIT command
    waitcnt(wait/5 + cnt)
    senddata("G")
    print(13)
    print(13)
    recdata························ ·'Line 316 (see below)

    Here is the bblu method:

    PUB bblu
    · Key.clearkeys
    · Repeat until key.gotkey
    · ‘this condition is met when I press a key in "recdata"
    ···· Bs.pwm(blu1, 175, 10)


    Here is the recdata method:

    PUB recData | c····················· 'receives time from Stamp C
    · c := serialIn(0,stampBaud,sim#NInv,8)
    · repeat until (c := serialIn(0,stampBaud,sim#NInv,8)) == 10
    ··· print(c)
    · print_string(string(13,13," Press any key to continue"))
    · key.getkey
    · ·‘when I press a key I want the PWMing in PUB bblu to stop

    The problem is – when I press "G" the bblu PWM starts and stays in the repeat loop until I press a key. The PWMN stops and THEN it gets the time. I would like for bblu to PWM until I press a key as called for in "recdata". This means the the PWM stuff has to be in a separate cog so it can run concurrently with "recdata", and this I have not been able to do. I will need about five or six methods in the PWM cog, each of which can be called by different methods in my main program.

    Have I properly explained what I want to do?

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • deSilvadeSilva Posts: 2,967
    edited 2007-11-02 18:56
    I posted an extremely easy to use all purpose PWM module the other day - have a look at the thread "Tutorial on PWM"
    http://forums.parallax.com/showthread.php?p=685997
    As there had been no (negative) feed back in the mean time I shall also post it as a pdf as part of my Tutorial Library.

    Post Edited (deSilva) : 11/2/2007 7:05:10 PM GMT
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-11-04 22:15
    Hi Sid,
    Sorry, I was away for a few days without time to delve into Q & A here.

    I'm not sure I totally follow, PWM_Set does run while other code is running - it uses the counters.

    [noparse][[/noparse]code]
    Not sure this is valid,

    repeat until (c := serialIn(0,stampBaud,sim#NInv,8)) == 10
    print(c)

    how about something like:
    repeat until c == 10
    c := serialIn(0,stampBaud,sim#NInv,8)
    print(c)
  • NewzedNewzed Posts: 2,503
    edited 2007-11-04 23:25
    Thanks, Martin.· The biggest problem is I don't really know what I'm doing.· Something happens to my display and I can't figure out the problem 0- I just try something new.· You know - if Button A doesn't work, try Button B.· I found out a lot of my problems were with the stack size.· Right now·I have VAR stack[noparse][[/noparse]150] and everything seems to be working.· As I expand the program I'm sure something else will go wrong.· Oh, well..............

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
Sign In or Register to comment.