Shop OBEX P1 Docs P2 Docs Learn Events
SX28AC/DP Reset — Parallax Forums

SX28AC/DP Reset

John WhitfieldJohn Whitfield Posts: 42
edited 2005-06-11 23:39 in General Discussion
I am trying to implement my multimeter design on a board and am having problems. According to the datasheet and the reset document available in the sx downloads I should be able after programming the chip on a board be able to tie not MCLR to VDD and it should begin operating or I should run a line from VDD through a circuit with a diode, capacitor, and some resistors. Neither of these seem to work. Does anyone know where I can find a more practical explaination of how to do this or why it is not working correctly?

Thanks,
-John Whitfield

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-06-08 22:54
    John,

    All you need is a pullup resistor (10k will do) between the MCLR pin and the power supply (VDD).

    Then by pulling the MCLR down to GND and release it (i.e pushbutton between MCLR and GND)

    you reset the SX.

    regards peter
  • NateNate Posts: 154
    edited 2005-06-08 23:32
    John,

    If Peter's sugestion does not work...and you probably already know this..., but when running the SX w/o the SX key you need to either enable the internal oscillator or connect an external oscillator.· Remember to put in the DEVICE commands suitable to the oscillator setup you are using.

    Nate
  • mojorizingmojorizing Posts: 249
    edited 2005-06-09 00:55
    Peter,

    Is the resistor necessary when there is no reset circuit ? All the examples of schematics of various SX circuits on the web have a reset circuit ( pull down resistor w/ push button). I've directly connect the MCLR to VDD only with no apparent problems, but I wonder if I'm missing something.

    Thanks, Kevin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are 10 kinds of people in the world.... those that know binary, and those that don't.
  • John WhitfieldJohn Whitfield Posts: 42
    edited 2005-06-09 01:46
    I am already using a switch to control the power to the entire circuit, and so I would hate to add a button. I will try just a resistor tomorrow unless the power needs to already be on before the voltage hits the MCLR.

    Thanks,
    -John Whitfield
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-06-09 02:07
    You don't need a pushbutton, unless you want to reset the sx without

    recycling the power. You can connect MCLR directly to VDD but then

    you have no option to add a reset pushbutton later if you wanted.

    regards peter
  • BeanBean Posts: 8,129
    edited 2005-06-09 10:44
    John,
    Depending on your power supply, you may also have to use the "Brown-Out-Reset" option. If your running from 5V then add "BOR42" to the device line. I think the problem occurs when the supply voltage does not rise fast enough.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    Product web site: www.sxvm.com

    "If you keep doing what you always did, you'll keep getting what you always got."
    ·
  • John WhitfieldJohn Whitfield Posts: 42
    edited 2005-06-09 20:47
    I added th BOR42 to the code and it still doesn't work. Maybe the internal oscillator is the problem I am running at 50MHz, how do I implement that? I am going to buy some pullup resistors right now just in case.

    -John Whitfield
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-06-09 21:10
    The internal oscillator is 4 MHz.
    To use 50MHz (as specified by freq in your program) you need an external resonator.
    I use the following for 50MHz resonator:
    device··SX28,oschs1,turbo,stackx,optionx·;sx device options
    irc_cal··IRC_SLOW
    freq··50_000_000
    regards peter
    ·
  • John WhitfieldJohn Whitfield Posts: 42
    edited 2005-06-09 21:54
    I added th BOR42 to the code and it still doesn't work. Maybe the internal oscillator is the problem I am running at 50MHz, how do I implement that? I am going to buy some pullup resistors right now just in case.

    -John Whitfield
  • John WhitfieldJohn Whitfield Posts: 42
    edited 2005-06-09 21:55
    Sorry the last message accidentaly got sent again.
    -John
  • John WhitfieldJohn Whitfield Posts: 42
    edited 2005-06-10 00:16
    I don't know if there is something simple I am missing about the hardware, but I can't get the oscillator to work. I was wondering if anybody thought this code could be rewritten simply to be operated at 4MHz with the internal oscillator, since I think maybe the timing is why the chip appears not to work with the external oscillator.

    Thanks,
    -John Whitfield
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-06-10 06:30
    freq· 4_000_000

    IntPeriod········ = 208
    ; UART1 1200 Baud for the DMM
    ;
    ; Note that the timing used here is for 2400 Baud,
    ; therefore, the UART1 code will be executed every
    ; second ISR call only, resulting in half the speed,
    ; i.e. 1200 Baud.
    ;
    BaudBit1········· = 3
    StartDelay1······ = 8+4 ; = 2^BaudBit * 1.5
    RxBitCount1······ = 9······· ; = 7 data, 2 stop
    ; UART2 9600 Baud for the SpeakJet
    ;
    BaudBit2········· = 1
    StartDelay2······ = 2+1· ; = 2^BaudBit * 1.5

    ;4_000_000 / 9600 = 416 = 2 * 208
    ;4_000_000 / 2400 = 8 * 208

    regards peter
    ·
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-06-10 08:00
    John,

    after running your program with the SX-Key debugger did you re-program the SX using the "Run - Program" option? The code transferred into the SX for debugging contains additional instructions to communicate with the debugger. When this code is still in the SX progam memory, it can't work stand-alone.

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

    G
  • BeanBean Posts: 8,129
    edited 2005-06-10 10:56
    John,
    The internal oscillator is NOT stable enough for serial communications. It is +/- 8%
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    Product web site: www.sxvm.com

    "If you keep doing what you always did, you'll keep getting what you always got."
    ·
  • John WhitfieldJohn Whitfield Posts: 42
    edited 2005-06-10 19:06
    I used the program option in the run menu. I was under the impression that the internal oscillator was more stable from the information in the book. I tried to connect the oscillator according to the diagram in the book, but I do better with more practical hardware pictures, does anybody know where I can find something like that?

    Thanks,
    -John Whitfield
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-06-10 19:40
    John,

    assuming that you have a 50 MHz ceramic resonator (in most cases a blue device with three legs), connect the two outer legs to the OSC1 and OSC2 pins of the SX and the center pin to Vss (ground). According to the data sheets, you should also connect a 10 kOhm resistor in parallel to the OSC1 and OSC2 pins.

    Make sure that the source code contains a DEVICE OSCHS2 or DEVICE OSCHS3 directive to activate the internal oscillator driver.

    When you use one of the two resonators that come with the SX Tech board, make sure to pick the right one - one is for 50 MHz, and the other for 4 MHz.

    BTW: You have tied the MCLR* pin to Vdd via a pull-up resistor?

    Another test: When you have provided a 4-pin header for the SX-Key on the board, remove the resonator, plug in the SX-Key, and use the "Run-Clock" option of the SX-Key IDE to let the SX-Key supply the clock to the SX. From the dialog window, you should select 50 MHz (provided that the timing in your program is still for that frequency). Does the program work correctly in this case?

    Well, I'm doing some guesswork here - it would be easier for us to help you if you were a bit more specific when asking questions. For example, what type of external oscillator you are using. In one of your posts you wrote:

    "Maybe the internal oscillator is the problem I am running at 50MHz, how do I implement that? I am going to buy some pullup resistors right now just in case."

    Does this mean that you expect the internal oscillator to run at 50 MHz? Maybe, the FREQ 50_000_000 directive in the source code makes you believe that this might be possible but this is not the case. The FREQ directive is just important for the SX-Key debugger and the "Run-Run" menu option to "tell" the SX-Key which clock frequency it shall generate. It has no influence on the SX-internal oscillator, or any clock devices connected externally. You can find more info about that topic in the FAQ document that I have posted in one of the "sticky" threads at the top of this forum section.

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

    G
  • John WhitfieldJohn Whitfield Posts: 42
    edited 2005-06-10 21:17
    Sorry about the vagueness of my posts, I am being pulled apart by this project and my classes. I do have a pullup resistor connected from VDD to MCLR. I am using the blue 50MHz resonator that came with programmer. I connected it in the manner which you specified above, but was using OSCHS1. I will try it the other way.

    -John Whitfield
  • John WhitfieldJohn Whitfield Posts: 42
    edited 2005-06-11 00:24
    That doesn't work, but I went and bought an external oscillator by kyocera that generates 46Mhz and use it to generate an external clock signal when I get to the lab tomorrow.

    -John Whitfield
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-06-11 08:40
    John,

    I never had problems with the ceramic resonators supplied by Parallax - I think I have used almost 1000 of them so far. Therefore, when correctly connected to the SX pins, it should work. I assume that something else is still wrong with either your setup or the code making you believe that the clock is not working. Why don't you try a simple program, for example, one that periodically turns on and off an output and see if this works. If you have an oscilloscope available in the lab with sufficient bandwidth, you can check the OSC1 pin. The scope should display the clock signal when the oscillator is working.

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

    G
  • John WhitfieldJohn Whitfield Posts: 42
    edited 2005-06-11 23:39
    I checked it on the oscilloscope and finally realized that the part of the breadboard I was using in the lab was dead, so now it works on another part of the board. I will have to talk to the guy that runs the lab. Sorry about that.

    Thanks,
    -John Whitfield
Sign In or Register to comment.