 |
|
 |
| Parallax Forums > Public Forums > SX Microcontrollers, SX/B Compiler and SX-Key Tool > Device config window, and Device Directive in code listing... | Forum Quick Jump
|
|  dkemppai Registered Member
        Date Joined Oct 2004 Total Posts : 314 | Posted 10/27/2004 6:04 AM (GMT -8) |   | | Hi all,
I'm having a little trouble programming my SX chips to work correctly with the 50mHz
ceramic resonators. Also I'm having trouble with the "Device" window behaving poorly.
My main problem is that the SX-Key software appears to override any device directives
listed in the code. OSCHS2, for example will not be properly programmed into the SX chip,
unless the "Device" window is updated the correct oscillator also. Also, the "Device" window
settings are not saved at all. Thus on subsiquent restarts of the SX-Key software, previous configurations are lost.
Maybe I'm missing something here, but I would think that the code directives should override
the SX-Key directive?!? I would think that this would help to ensure proper directive being programmed into the chip.
Also, the "Device" window seems unreliable at times. Clicking on some check boxes and radio buttons 'greys' out some settings that are avaliable when the window is open even when they appear to be unrelated. (Changing boxes and buttons back does not return the options)
Any insights that I'm missing???
Thanks!
Dan
| | Back to Top | | |
 |  PJMonty Registered Member
        Date Joined Jul 2004 Total Posts : 1009 | Posted 10/27/2004 9:04 AM (GMT -8) |   | Dan,
My personal advice (others pay disagree) is to treat the device window as basically a "read only" dialog. All settings you want to make need to be in your "DEVICE" directive(s) in your code. Anything you have in the code will supercede the device directive and set the various checkboxes, etc on it.
Try this experiment:
1 - Load the source for a working project into the editor
2 - Open the device window and move it so you can still see it when the you are working in the editor.
3 - Assemble the code.
4 - Change the DEVICE directive in the code so it uses a different chip. For exampl,e, if you're using the SX28 in the DEVICE directive, change it to SX48
5 - Assemble the code while watching the device window.
You'll see that as soon as you assemble the code, the device window is updated to reflect the DEVICE directive in your code. The moral of this story? Don't try and "set" things in the device window, just treat it as a way to load and save hex files, and to visually confirm your DEVICE directives.
| | Back to Top | | |
 |  dkemppai Registered Member
        Date Joined Oct 2004 Total Posts : 314 | Posted 10/27/2004 10:33 AM (GMT -8) |   |
PJMonty said... Try this experiment:
1 - Load the source for a working project into the editor
2 - Open the device window and move it so you can still see it when the you are working in the editor.
3 - Assemble the code.
4 - Change the DEVICE directive in the code so it uses a different chip. For exampl,e, if you're using the SX28 in the DEVICE directive, change it to SX48
5 - Assemble the code while watching the device window.
I figured it out... ...Sort of... ...but it doesn't work as expected, always...
If the directives are ordered improperly, it appears that the default setting are recalled...
Try the directive like this...
DEVICE SX28L ;28 pin chip DEVICE OSCHS2 ;(OSC or External TTL OSC)
Then try the directive like this...
DEVICE OSCHS2 ;(OSC or External TTL OSC)
DEVICE SX28L ;28 pin chip
You will get different results with Each example...
Ok, so the question is, what is the proper order of operations when
setting the device directives in code???
Is the directive specifying which mcu is the target device the only important one?
-Dan | | Back to Top | | |
 |  Bean (Hitt Consulting) Forum Moderator

       Date Joined Jul 2004 Total Posts : 5761 | Posted 10/27/2004 10:45 AM (GMT -8) |   | I always but all the directives on one DEVICE line and never had a problem.
Bean. | | Back to Top | | |
 | Forum Information | Currently it is Saturday, November 21, 2009 11:22 AM (GMT -8) There are a total of 393,851 posts in 55,536 threads. In the last 3 days there were 84 new threads and 702 reply posts. View Active Threads
| | Who's Online | This forum has 17692 registered members. Please welcome our newest member, old guy. 39 Guest(s), 17 Registered Member(s) are currently online. Details heater, MichelB, Peter Jakacki, Jay Kickliter, Mike Green, Alsowolfman, Shawn Lowe, Luis Digital, dMajo, Harley, Sapieha, Harprit, Rick Brooks, Beau Schwabe (Parallax), SRLM, Tubular, ERM |
Forum powered by dotNetBB v2.42EC SP2.02 dotNetBB © 2000-2009 |
|
|