Shop OBEX P1 Docs P2 Docs Learn Events
sx-28 dp question — Parallax Forums

sx-28 dp question

Blackbird455Blackbird455 Posts: 124
edited 2007-08-29 16:06 in General Discussion
in the manual, in the connection diagram section, it states that the 10k resistor connected to the MCLR pin is not needed when controlled externally.........does the MCLR pin need to be high all the time to keep it from getting bumped low accidentally? Or ,if not, what is the purpose?
«1

Comments

  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2007-08-23 07:26
    In order to have the SX operate normally, MCLR must be permanently tied to Vdd. As the MCLR has no internal pull-up, it is not a good idea to leave it floating, i.e. open, as this most likely resets the device as soon as the pin floats below the high-threshold. IOW, you either should use a pull-up resitor, like 10k to Vdd, or controll it externally, keeping it high as long as you don't want to reset the device. When controlling it externally, it is a good idea to place a 470 Ohm resistor in series with MCLR to limit current into the internal clamping diodes in case the external signal exceeds the allowed maximum of 7V (maybe due to "spikes" on the line).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • Blackbird455Blackbird455 Posts: 124
    edited 2007-08-23 15:04
    OK thank you, I did use a 10k tied to Vdd, as my basic stamp experience told me............. Now I have another problem........I am using the SX Blitz USB to try to program an SX28...........and SX KEY v 3.2.3, It wont find it. I have tried to verify it and it just wont work......... What am I doing wrong? Is there a tutorial for noobs anywhere?
  • BeanBean Posts: 8,129
    edited 2007-08-23 15:21
    What is the exact error you are getting.
    "It won't find it" doesn't really help [noparse];)[/noparse]

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Teacher: What is the difference between ignorance and apathy ?
    Student: I don't know and I don't care
    Teacher: Correct !
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • Blackbird455Blackbird455 Posts: 124
    edited 2007-08-23 15:34
    "unable to open com 9....com port in use by another process" until i checked my connections, now it is saying "chip connection failed"
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2007-08-23 15:57
    1) Did you install the FDTI virtual comm port driver on the PC? You should have done this BEFORE you connect the SX-Blitz USB the first time.
    2) When the drivers are installed correctly, try the following:
    - unplug the SX-Blitz, launch the SX-Key IDE, select "Run - Configure" and memorize the available COM ports listed.
    - shut down the IDE, plug in the SX-Blitz, and launch the IDE again.
    - Select "Run - Configure" - the list of available COM ports should have a new entry now - the one for die SX-Blitz, so select this one.
    3) Try to program the SX again.

    When you get an error like "chip connection failed", this indicates that the IDE and the SX-Blitz have established communications (otherwise, you would get an error like "SX-Key/Blitz not found on COM 9") but that the communication between the SX-Blitz and the SX chip has failed. Often the problem is simply gone when you re-try programming.

    Other reasons for this error can be bad electrical connections (SX-Blitz to 4-pin header, SX to socket), or a weak power supply. A tantalum cap of 47µF between Vdd and Vss often helps a lot.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    Günther
  • Blackbird455Blackbird455 Posts: 124
    edited 2007-08-23 21:40
    Ok it worked!!!! I got it running.........now I just have to figure out the code......I got a sample code from someone....but it is not working, HELP PLEASE!!!!

    All I want is RB5 and RB7 to do certain things, and they are just randomly oscillating.
    If I were to write this in BS1 i would do it like this:

    SYMBOL reps = W1
    SYMBOL i = W1 ' FOR...NEXT loop counter

    Main:
    FOR reps = 0 TO 65535 STEP 3000
    FOR i = 1 TO 64
    TOGGLE 5
    PAUSE 11
    NEXT
    PAUSE 100
    FOR i = 1 TO 4
    HIGH 7
    PAUSE 20
    LOW 7
    PAUSE 50
    NEXT
    PAUSE 150

    NEXT

    How would you accomplish this with the sx28?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ETERNAL NOOB
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2007-08-23 22:51
    Hey Blackbird455,

    good to learn that you've got it running - on the behalf of others who follow this thread, let me ask one simple question: WHY smile.gif . IOW what did you change/fix to make it finally work? The experiences you have made might be helpful for others in the future.

    Concerning your code problem, we (speaking for the community of helpful individuals in this forum) could better help you if you'd post the non-working sampe code you got from someone, instead of some BS1 code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • Blackbird455Blackbird455 Posts: 124
    edited 2007-08-23 23:22
    ok I made this...........view the attachment................and then kept trying to connect, finally did, but have not since..........think i fried the blitz.

    Here is the code, it might be good , but all i got was oscillation, even after changing delay_ms 40 to 2000:

    ' ========================================================================='' File...... REPS.SXB' Purpose...' Author.... Jon Williams, EFX-TEK' Copyright (c) 2007 EFX-TEK' Some Rights Reserved' -- see http://creativecommons.org/licenses/by/3.0/' E-mail.... jwilliams@efx-tek.com' Started...' Updated...'' ========================================================================='
    ' Program Description'
    '
    ' Conditional Compilation Symbols'
    '
    ' Device Settings'
    DEVICE SX28, OSC4MHZ, TURBO, STACKX, OPTIONX, BOR42FREQ 4_000_000ID "Reps"'
    ' I/O Pins'
    Light1 PIN RB.1 OUTPUTLight2 PIN RB.7 OUTPUT'
    ' Constants'
    IsOn CON 1IsOff CON 0'
    ' Variables'
    reps VAR Wordidx VAR BytetmpW1 VAR Word' =========================================================================' INTERRUPT' =========================================================================' RETURNINT' ========================================================================= PROGRAM Start' ========================================================================='
    ' Subroutine / Function Declarations'
    DELAY_MS SUB 1, 2'
    ' Program Code'
    Start:Main: FOR reps = 0 TO 65535 STEP 3000 FOR idx = 1 TO 4 Light1 = IsOn DELAY_MS 40 Light1 = IsOff DELAY_MS 40 NEXT FOR idx = 1 TO 4 Light2 = IsOn DELAY_MS 40 Light2 = IsOff DELAY_MS 40 NEXT NEXT END'
    ' Subroutine / Function Code'
    ' Use: DELAY_MS mSecs' -- delays program in millisecondsSUB DELAY_MS IF __PARAMCNT = 1 THEN tmpW1 = __PARAM1 ELSE tmpW1 = __WPARAM12 ENDIF PAUSE tmpW1 ENDSUB'
    '
    ' User Data'


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ETERNAL NOOB
    514 x 289 - 45K
  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-08-23 23:22
    Blackbird,

    The document in this thread:

    http://forums.parallax.com/showthread.php?p=662519

    ... should be helpful to you. The program you want to translate you can do almost verbatim; the only thing that changes is having a proper SX header and the variable declarations.
  • Blackbird455Blackbird455 Posts: 124
    edited 2007-08-23 23:24
    uh............fried the blitz on accident...........had 5v going in osc 1 ..............oops!! not for sure tho.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ETERNAL NOOB
  • Blackbird455Blackbird455 Posts: 124
    edited 2007-08-24 00:31
    Hey are these things OTP or what? (one time programmable)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ETERNAL NOOB
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2007-08-24 00:37
    "unable to open com 9....com port in use by another process" until i checked my connections, now it is saying "chip connection failed"
    You can get a similar warning, if you have the Basic Stamp & SX IDE's open and program a BS2 first. The Basic Stamp IDE will have control of that com port and the SX IDE won't be able to access it.

    Bill
  • Blackbird455Blackbird455 Posts: 124
    edited 2007-08-24 01:26
    yeah i had that happen already.............Do i need to ground the MCLR pin to be able to re-program or what?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ETERNAL NOOB
  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-08-24 01:42
    You're working way too hard, Blackbird; just pull the MCLR line to Vdd through a 10K. If you want an external (manual) reset then you can add a normally-open button to ground. If you have a properly connected Blitz or Key it can take care of the rest.

    I've attached a schematic of one of my designs that shows the programming connections.
  • Blackbird455Blackbird455 Posts: 124
    edited 2007-08-24 02:01
    Thanks Jonny,
    I have a tendancy to do that.........like I say tho, I am a noob, I make noob mistakes.......sure wish I was as good at this as you all are lol! Thanks for your help!!!
    But, uh, so you are saying that while it is pulled high through a 10k, I can ground it out momentarily , and then it can be re-programmed?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ETERNAL NOOB
  • Blackbird455Blackbird455 Posts: 124
    edited 2007-08-24 02:10
    "chip connection failed" is all i get after I program a chip once.............I can put a new chip in , and it works fine, but try to re-program, and I get that message.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ETERNAL NOOB
  • BeanBean Posts: 8,129
    edited 2007-08-24 02:19
    Blackbird,
    I don't see any caps on your regulator. That may be causing the problem. A new chip will not oscillate (I don't think they do), but once programmed it will be oscilating and may be causing noise on the supply.

    Check the schematic on the regulator you are using, they will recommend a cap on the input and output of the regulator.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Teacher: What is the difference between ignorance and apathy ?
    Student: I don't know and I don't care
    Teacher: Correct !
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-08-24 02:20
    If you ground MCLR momentarily you will reset the SX -- but you don't have to do this for reprogramming; the Blitz or Key takes care of that.
  • Blackbird455Blackbird455 Posts: 124
    edited 2007-08-24 02:45
    yeah , like I said , once its programmed, Its unresponsive, it wont program or verify

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ETERNAL NOOB
  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-08-24 04:01
    The SX is a flash part, not OTP. What kind of setup are you using? -- if you built it yourself then start there; maybe you just don't have a enough beef with your 5v supply.
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2007-08-24 17:18
    Blackbird455,

    giving technical support to a forum member can be a real challenge when one gets the information about a problem in single bits and pieces over several posts :-( .....

    Ok, before trying to put together things here, one well-meant advise first: Keep cool, don't get nervous or hectic, and carefully read the already posted answers (they contain valuable information). If you are a smoker, smoking a cigarette might help, or maybe, drink a beer or some schnaps smile.gif .

    The picture you have posted shows your setup for an SX 28 programmer. So you have removed the 4-pin receptable from the SX-Blitz, and soldered it directly to the board (Arghhh - using a 4-pin header might be a better idea). For the SX, you have placed a 4-pin receptable for pins 25...28, so you have access to /MCLR, OSC1 and OSC2. I assume that there is another 4-pin receptable for pins 1 to 4 on the other side for Vdd and Vss.

    I'm a bit concerned about the receptables you are using. They are designed for square-shaped pins but not for the smaller pins on the SX DIP package. So you should concider replacing them by some "precision socket" types, similar to the DigiKey part-# ED7864-ND. Bad contacts can definitely cause errors like "Chip Connection failed". This even happens to me from time to time, although I'm using a Textool socket for my SX programmer.

    I also noticed the 10kOhm resistor to pull up /MCLR to Vdd, which is absolutely necessary (provided that the solder pad for the right end of the resistor is connected to Vdd). I also see the voltage regulator but I can't determine which type it is. What I don't see at all are any filter caps around the regulator. You should at least add a 47µF elcap between the Vout and the GND pins to avoid a voltage drop when the SX-Blitz starts programming the device. It is also a good idea to place two 100nF ceramic caps from Vin to GND, and from Vout to GND to avoid unwanted oscillations of the regulator (the 7805 types tend to do this from time to time).

    You have mentioned that you could program an SX only once with this setup. Although this might be bad at first glance, it is really good news, as it tells you that the SX-Blitz works, and that the SX28 is fine, and you can be sure that it is very unlikely to kill an "SX virgin" when it is programmed "for the very first time" (sorry, Madonna) smile.gif .

    One general remark for future designs: As long as you are only going to use this setup together with an SX-Blitz for programming, this is fine. Should you ever plan a similar setup with an SX-Key for debugging SXes, be aware that the length of the OSC1 and OSC2 leads between the SX-Key and the SX under test is a critical matter - IOW, the shorter, the better. With your setup, you might have trouble when running the SX at higher clock frequencies, like 50 MHz.

    Don't smoke/drink too much, and good luck smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    Günther
  • dkemppaidkemppai Posts: 315
    edited 2007-08-24 21:11
    Blackbird455 said...
    yeah , like I said , once its programmed, Its unresponsive, it wont program or verify

    I've had this happen in the past. Not sure exactly what causes it. I did eventually figure out
    it was related to how I programmed the oscillator settings on the previous programming
    cycle.·What ever it did, it would lockup the chip and·programmer. Swiching chips·would verify
    that it was in fact the chip.·In my case the chip and key would get warm when trying to program.
    It was not a power supply related issue.

    What I did, was unplug they key, and let everything cool. Then with the software
    open, plug the key in to the chip and very quickly mash down on the program button...
    9 times out of 10, it would·program again. If it plugged it in, and let it sit, it wouldn't
    program until it cooled off and had a power cycle.

    -Dan


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    "A saint-like quantity of patience is a help, if this is unavailable, a salty vocabulary works nearly as well." - A. S. Weaver
  • Blackbird455Blackbird455 Posts: 124
    edited 2007-08-25 01:44
    ok , how do you know which oscillator setting to use? I noticed in the code that jonnymac wrote it indicated 4mhz, and that is what I selected on the console. All I need is approximate milisecond resolution, nano is way too precise, so , is 4mhz the right setting?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ETERNAL NOOB, you could learn alot from a dummy
  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-08-25 02:08
    4 MHz will work; but with it comes the additional selection of internal or external. You have a Blitz so you can only program the device, you'll have to disconnect and attach a resonator for external or just reset for internal (I have found it's best to disconnect the Blitz after programming).
  • pwillardpwillard Posts: 321
    edited 2007-08-25 19:07
    I hope I'm not sounding like I'm insensitive to your programming·problems, since I'm not offering advice at the moment,·but why would you do that with an SX-blitz? I'm sitting here trying to come up with a reason why I would mess with mine like that and it's just not coming to me.·My curiousity is getting the best of me, I guess.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    There's nothing like a new idea and a warm soldering iron.
  • Blackbird455Blackbird455 Posts: 124
    edited 2007-08-26 00:30
    HAHAHA! that seems to bother some people........guess maybe it should bother me.........the reason , i was getting bad connections and just wanted to simplify the process

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ETERNAL NOOB, you could learn alot from a dummy
  • dkemppaidkemppai Posts: 315
    edited 2007-08-26 01:26
    Blackbird455 said...
    ok , how do you know which oscillator setting to use? I noticed in the code that jonnymac wrote it indicated 4mhz, and that is what I selected on the console. All I need is approximate milisecond resolution, nano is way too precise, so , is 4mhz the right setting?

    Oddly enough, I was using a 4Mhz resonator on that project. So, I was setting the frequency to 4Mhz. However, I don't
    remember which OSC drive levels I was using. I do remember that changing them fixed the problem...

    The worst part, is when I tried to point out this problem, no one else·could seem to reproduce it.
    Everyone thought I was crazy! Now, there's two of us·who are nuts!·

    -Dan


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    "A saint-like quantity of patience is a help, if this is unavailable, a salty vocabulary works nearly as well." - A. S. Weaver
  • Blackbird455Blackbird455 Posts: 124
    edited 2007-08-28 04:18
    Nothing is working now, I think that the blitz is fried, think I'll get an SXtech board.........does anyone have any experience with one? Looks like it might be what I need.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ETERNAL NOOB, you could learn alot from a dummy
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2007-08-28 07:41
    Did you check if the SX is contacted properly? In one of my previoous posts, I already mentioned that using the standard 1/10" header sockets are a potential source of trouble, as the SX pins are too small.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • Blackbird455Blackbird455 Posts: 124
    edited 2007-08-28 21:21
    Gunther,

    ·Yes I have ensured contacts are sufficient......... 0.00- 0.001 ohms.........the socket has double wiper contacts. As I mentioned earlier, I accidentally supplied Vdd into the OSC 1 pin for the first five minutes of the blitzes life, I think that has something to do with my problems........I am going to just scrap it and get an SX Key, and try not to kill it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ETERNAL NOOB, you could learn alot from a dummy
Sign In or Register to comment.