In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Rsadeika wrote: I am still using the Guenther code, the listing that I have is functional, I have some remarks through out the code, so if somebody notices a glaring mistake, please make me aware of it. Now, I have a question about the proper usage of IRC_CAL. The DEVICE OSC4MHZ selects the SX internal RC, and you get three choices of IRC_CAL IRC_SLOW, IRC_4MHZ, and IRC_FAST. In the data sheet it states something about a +-8%, I assume that IRC_SLOW would be a calibration at -8%, and IRC_FAST would be a calibration of +8%. What kind of calibration does IRC_4MHS get? So, I guess you get a warning here, do not use this setting if you will be using this to send a rocket to Mars. The DEVICE OSCHSx selects one of the High speed crystal/res. choices, and as turns out you get to use an IRC_CAL setting, also. So, when you select IRC_SLOW or IRC_FAST, what exactly do you get? When you leave out the IRC_CAL setting, the compiler gives a warning that it is using the default IRQ_SLOW setting. When I am using a freq 50_000_000, in the run window it just shows that the freq of the program is 50_000_000. Does the same warning apply here, do not use for rocket science. I guess my question is for the more experienced programmers, down the road, will this come in handy, the usage of IRQ_CAL. At this point I am sort of missing the utility of the IRC_CAL setting. A couple of examples could be in order, if possible. Ray Thanks in advance ****CODE ;;; ;; Tut003.src ;;; device sx52 device oschs3 ;High speed crystal, 1MHz - 75MHz ;IRC_CAL IRC_FAST ;Real life utility still undecided freq 50_000_000 ;**** ;device osc4mhz ;This uses the SX internal RC ;IRC_CAL IRC_FAST ;Specific for 4MHz selection ;Selections are IRC_CAL IRC_FAST, ;IRC_4MHZ, IRC_SLOW ;freq 4_000_000 ;Can use different freq's up to 4MHz ;**** reset Main ;Label where the program starts ;Data area ;I lean towards structure, this notation ;is for me to make things a little easier org $0A ;This is the starting point for Data ;and Code, the compiler sorts it out ;SX52 -> $0A, SX28 -> $08 ; Counter1 ds 1 ;Remember code can be placed here Counter2 ds 1 ;also, the compiler distinguishes Counter3 ds 1 ;between variables and code ;End of data ;Code area org $0 ;Code start position on reset Main mov w,#$1f ;This is SX52 specific -> TRIS_ mov m,w mov !rd,#%11111110 ;Set rd.0 to output Loop decsz Counter1 ;Counter1 is a byte, descsz starts at 255 ;and decrements until it hits 0 jmp Loop decsz Counter2 jmp Loop decsz Counter3 jmp Loop clrb rd.0 ;Turn on the LED Loop1 decsz Counter1 jmp Loop1 decsz Counter2 jmp Loop1 decsz Counter3 jmp Loop1 setb rd.0 ;Turn off the LED jmp Loop jmp $ ;I like to use this to end my code, ;at this point it is in an endless loop. end ;End of source code, remmarks can be placed ;here after 'end'. The compiler treats ;it as text and is ignored. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=101243 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)