SX28AC/DP Reset
John Whitfield
Posts: 42
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
Thanks,
-John Whitfield
Comments
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
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
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.
Thanks,
-John Whitfield
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
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 Whitfield
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 Whitfield
-John
Thanks,
-John Whitfield
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
·
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
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."
·
Thanks,
-John Whitfield
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 Whitfield
-John Whitfield
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
Thanks,
-John Whitfield