Jump to content

Compile Problems


Jidis
 Share

Recommended Posts

Hi,

At the very end of a bunch of frustration, asm changes, and troubleshooting, I discovered last night that MPASM may actually be to blame for some of the non-working apps I've tweaked.

With no code changes at all, the pre-compiled MB64 2.4 hex program loads and runs OK (from MIOS Studio), although I am using a 2x40 display, 8 buttons, 16 LEDs, and 1 pot on a 4051. If I recompile it myself with no source changes, MIOS Studio reports a changed hex file and the new app reboots with crazy flickering characters all across the display and erratic or no response to button presses. This is similar to the kind of apps I was getting while trying to customize the i/o and LCD parameters in the source.

Is anyone familiar with this and, ideally, know of a solution? I moved my compiling and MIOS Studio stuff to my main XP machine, because the 98lite secondary rig wouldn't let MPLAB 6 or 7 install, and the older Microchip stuff didn't recognize any of these projects or files. I believe the one I'm running under XP is 7.01, and I've got most of MPASM's boxes set to the defaults and have it set to output a .hex file for the 18f452.

                                                           -Thanks!

George

Link to comment
Share on other sites

For anyone interested in the future, this appears to have been caused by the "radix" checkbox in MPASM. I had unknowingly checked that for hexadecimal, and specified the processor type, like I did in most of the 16f84 beginner exercises in the book I was in. Leaving it at the default (dec?) seems to have fixed it. I'm also now on MPLAB 7.2, but it makes the same mess with hex on. The resulting app was weird. It sort of looked like it went OK, but splattered crazy characters all across the display.

                                                       -George

PS- I'm still fighting with the 2x40 thing. I copied the offset parameters from the SEQ LCD file, which has a single display 2x40 option, but I just got the same 2x16 output pushed over to the right end of the screen. The four parameters were 18,58,00 and 40. I'm guessing the 18h was the 24 spaces to the right that it started at, the 40h was the 64th point for the start of the second line(?), and I'm lost on the other two (if I didn't flunk the first ones ;) )     

Link to comment
Share on other sites

Hi George,

Mchip changed the project file format completly with V7.x it now has a .mcp extention.

The 'killer' is normally associated with the project options, for example my programmer will only work with an INHX8M format .hex file. The default is INHX32. I don't know what format the original file from TK is. This is changed under the build options. My opinion is that you should always specify the radix in your 'main' asm file and do what TK does and specify the radix when used. 0x13 is hex, so is 13H, 'D'19 is the same but in decimal and 'B' 00010011 is a method of using Binary. I am sure the is other ways as well.

I have not been following your original problem, could you point me to the thread.

Cheers,

Dave

Link to comment
Share on other sites

Dave,

Thanks! Yeah, the book I used sounded like it just meant that numbering in the code would be accepted as hex or whatever, unless you specified otherwise for an instruction. I'm guessing that's why Thorsten has the 0x's in there, and the default is decimal.

The problem I mention at the bottom is no big thing. I'm just struggling with where all the custom LCD parameters are supposed to be specified, what they do and what they are for mine. I see all these cool gallery boxes with LCD content that looks as if it's spread across the screen to align perfectly with the control layouts.

So I'm basically just wondering what the exact settings are for a single 2x40, where they need to be (other than main), and if I can work that out, later I'll get into arranging and naming parameters within the display. The 2x40 should probably be common enough now to be one of the default options in all the MIOS apps.

                                                             Take Care

George

Link to comment
Share on other sites

Hi George,

Don't use MB64 here but looks like you will need to create a new LCD file (base is on "cs_m_display_2x20.inc") couple of changes to main.asm (#Defines and includes) and then make sure the Cursor position is set to suit. Be carefull as some 2*40 lcd's think they are 4*20 with regard to cursor.

Dave

Link to comment
Share on other sites

looks like you will need to create a new LCD file (base is on "cs_m_display_2x20.inc")

Funny, I think that's exactly what I ended up doing last night ;D

I started off tinkering with the 2x16 settings and I think I also ran into that problem you mention with the app thinking there are four lines (half the parameters seemed lost somewhere). I ended up doing the 2x20 and doubling some of the parameters, also had added 12 to get to the center of the display, but what I ultimately ended up working with was a 2x16 block in the middle of the display (sort of strange looking). I'm not sure if that's what Thorsten meant in the note about being able to modify one of the defaults to use larger screens, or how some of the gallery boxes have the 4 channels worth spread across the 2x40. It looks like I need to carry the cs_m_ display file with me tonight for some reading.

PS- (If TK sees this) - The first "0" option in the mains is listed as 4x20, but it isn't hard to catch, as it doesn't match the 4x20 values on #3

                                                                - Thanks!

PS- I've now also got the bankstick formatting loop that a couple others got here. It's got to be a connection issue, but all 8 lines check perfectly and I think it worked when I first connected it. I swapped the chip and it did the same (I've also got the 5v pullup on that one pin)        - I probably don't need a bankstick, so if worse comes to worst, I'll just pull it. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...