Shop OBEX P1 Docs P2 Docs Learn Events
C programming for SX — Parallax Forums

C programming for SX

DJFXDJFX Posts: 15
edited 2005-12-06 16:51 in General Discussion
Hello I have a particular problem when using Byte Craft to program the SX.· It only works when I leave the SX-Key connected.· I was wondering if anyone else has had this problem or maybe can assist me with this issue?· Any help would be greatly appreciated.·

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-12-04 07:18
    Are you placing the resonator in it's socket after removing the SX-Key?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • DJFXDJFX Posts: 15
    edited 2005-12-04 08:04
    The resonator is already placed on the board.
  • RsadeikaRsadeika Posts: 3,837
    edited 2005-12-04 13:15
    You may have to supply us with more info, like, are you using the SX tech board, ..., etc. In one of the other posts I talked about a problem where the program runs as expected with SX-key in place, but it does not run when in stand-alone (I use SX/B). Still working on this one. Out of curiosity does your program use pulsin·or equivalent command.
  • Ron BelknapRon Belknap Posts: 2
    edited 2005-12-05 00:20
    I've seen the same problem, where the SX's don't want to run without the SX-Key attached.

    I find that the first few times I program an SX chip it works fine by itself, but after·being·programmed a dozen times or so,·it will only·startup properly·with the SX-Key attached.· I investigated further and found that the OSC wasn't oscillating.· I tried adding various resistors and caps on the resonator, which might work for a short while, but would eventually have the same problem.··To get reliable startup, I had to restrict my SX usage to applications that could use the internal 4 Mhz oscillator, though very recently I've·had·one SX-28 that needs the SX-Key to run on the SX Tech board·even with the·internal 4 Mhz clock.· Previous to this recent incident with the SX-28 on a SX Tech board, all·my earlier problems had occurred with SX-48's on custom PCB's or commercial USB·modules like the DLP-245SY, and the Elexol USB I/O 24.

    I use CCS SXC Compiler version 3.042.· I've tripled checked compiler directives and SX-Key fuse options, they're always been·correct.··My programs work fine, until·an SX·chip has been programmed too many times.· I can program a older known-good version on a problem chip and it won't startup properly, or burn the "problem" version of my program onto a new SX chip and have it work perfectly.

    SX-28 on Tech Board w/ Internal 4Mhz osc

    #include <SX28AC.h>
    #use delay(clock=4000000)
    #fuses INT4MHZ,NOWDT,NOPROTECT,PAR


    SX-48 on·DLP-245SY w/ External 50Mhz resonator

    #include <SX48BD.h>
    #use delay(clock=50000000)
    #fuses HS,NOWDT,NOPROTECT,PAR



    ·

    Post Edited (Ron Belknap) : 12/5/2005 7:18:38 AM GMT
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-12-05 02:37
    What are you using in your DEVICE directive?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • william chanwilliam chan Posts: 1,326
    edited 2005-12-05 10:00
    I think your resonator is too far away from the SX.
    Move it closer, then it will work.

    For 4Mhz resonator, use DEVICE oschs1.
    For 20Mhz or 50Mhz use oschs2.

    I will work, just needs a bit of time and effort.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-12-06 16:51
    If the oscillator won't go, it may be that the particular configuration is lacking enough power to drive it.

    While the oschs1, oschs2, and so on are assigned to particular frequency ranges, they basically are different levels of oscillator drive power.
    I suppose you could bump up one level if the oscillator won't go.

    Reconsider your hardware.
    The problem could be the kind of crystal one is using, the quality of the osillator device, voltage drop due to small or long leads, cold solder joints, not using capacitors on a resonator that requires them, or using an improper resistor omiting a resistor in parallel.

    So, if you have a good 'always working' resonator, set it aside for troubleshooting.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Sign In or Register to comment.