Shop OBEX P1 Docs P2 Docs Learn Events
control I/o voltage assembly help — Parallax Forums

control I/o voltage assembly help

latoftelatofte Posts: 9
edited 2011-05-05 07:25 in Propeller 1
I can not seem to figure out how to increase the voltage being output from my chip, it just wants to sit around .5v when I want the full 3.3
this is done in assembly

Comments

  • LeonLeon Posts: 7,620
    edited 2011-05-01 15:09
    Have you configured the pin as an output? It will be an input following reset.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-05-01 15:15
    You didn't say, but I assume you're talking about the voltage on an I/O pin. Roughly 0.5V (or less) is typical for a logic low output (a 0 bit in OUTA). You won't get quite as high as 3.3V on an I/O pin, but you'll get something on the order of 3.0V or higher with a logic high output (a 1 bit in OUTA). If you want more help with this you will have to post your schematic and your source code. You're probably not setting the appropriate bit in the OUTA register. Use the "Go Advanced" button for your reply. It has provisions for uploading files with your message.
  • latoftelatofte Posts: 9
    edited 2011-05-01 17:39
    that would make more sense that it is a logic low.

    CON
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000


    PUB Main
    {Launch cog to toggle P16 endlessly}
    cognew(@Toggle, 0) 'Launch new cog

    DAT
    {Toggle P16}
    ORG 0 'Begin at Cog RAM addr 0
    Toggle
    mov dira, Pin 'Set Pin to output
    mov Time, cnt 'Calculate delay time
    add Time, #$f 'Set initial delay here
    :loop
    waitcnt Time, Delay 'Wait
    xor outa, Pin 'Toggle Pin
    jmp #:loop 'Loop endlessly

    Pin long |< 16 'Pin number
    Delay long 600 'Clock cycles to delay
    Time res 1 'System Counter Workspac

    this was taken from gadgetgangster.com's propeller assembly guide.
    It works just fine in gear (which is what the tutorial is more worried about) but obviously when I try to put it onto the chip it does not output correctly.
    thanks in advance :)
  • kuronekokuroneko Posts: 3,623
    edited 2011-05-01 18:00
    latofte wrote: »
    It works just fine in gear (which is what the tutorial is more worried about) but obviously when I try to put it onto the chip it does not output correctly.
    The code you listed generates a ~66kHz square wave on pin 16. On the chip, right now, next to me. What do you expect to happen?
  • Mike GreenMike Green Posts: 23,101
    edited 2011-05-01 18:17
    Your initial time delay may be too short. Try something larger like $100.
  • latoftelatofte Posts: 9
    edited 2011-05-03 11:36
    kuroneko wrote: »
    The code you listed generates a ~66kHz square wave on pin 16. On the chip, right now, next to me. What do you expect to happen?

    well that might be a problem right there, I am not getting that output, no matter what pin I assign it to.

    I am not sure exactly what I am expecting, this is from a beginners guide to parallax assembly. At one point during this example he mentions hooking up an LED to the output, but no results. And now I am here hoping to get this little light to simply light up
  • Mike GreenMike Green Posts: 23,101
    edited 2011-05-03 11:45
    Well, the code looks correct except that I'd increase the initial wait time a little. The example has worked for others and it works for kuroneko. Your task is to find out what's different about what you've got from what you're supposed to have. Often people wire something wrong and have trouble seeing it. Try getting someone else to look at it and compare what you have with what you/re supposed to have,
  • latoftelatofte Posts: 9
    edited 2011-05-03 16:25
    Took the whole thing apart and started from scratch and still nothing :(
    I am using the diagram from the propeller manual w/o the eeprom or crystal
    the propeller tool identifies the chip as a propeller chip version 1

    Is there anything I can use to check and make sure my chip is actually getting and running the code I am sending it besides the little lights it shows right when you tell it to run?
  • kuronekokuroneko Posts: 3,623
    edited 2011-05-03 16:34
    latofte wrote: »
    I am using the diagram from the propeller manual w/o the eeprom or crystal
    There is your problem. You set up the clock for 80MHz which requires a crystal.
    CON
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
    
    So if you just comment out the two lines above then the prop will run in RCFAST mode which - besides RCSLOW - is the only applicable mode right now for you.
  • latoftelatofte Posts: 9
    edited 2011-05-05 07:25
    That is the part I did not really understand what he was trying to do!
    awesome my lights a blinking and now I can stop thinking my chips all broke and get to some real programming!!
    thanks a bunch for trouble shooting my super lame code!
Sign In or Register to comment.