PDA

View Full Version : What have I done now?



Hylan
- 10th December 2008, 20:51
So I use one pic (18F6520) on one board and I use Microcode Studio Plus 3.0.0.5, PB Pro Compiler 2.50 and a MELabs usb programmer.

I set all this up about 2 yrs ago and haven't changed the set up at all. I regularly change the firmware, load it, run it and don't give it much thought.

Until today...

I grabbed a board to load a program onto and everything indicates that it loaded fine but it doesn't work. I was loading a known program so that wasn't the issue. I regularly load this program to work with. I tried several other programs same problem.

I finally went back to several known hex files that weren't compiled by Microcode Studio recently (but were compiled by it in the past) and they loaded fine. There are no known changes, to me, so I'm completely stymied.

I also tried to just compile the program and then open it from my programmer.

If you haven't guessed by now, I'm not a professionally trained programmer so I know just enough to be dangerous.

Any help is hugely appreciated.

Thank you,

Hylan
- 11th December 2008, 02:29
I've been trying to narrow this down a bit further. I have 2 programmers from MELabs. A usb powered one and a older db9 one. I dusted off the older one to rule out the hardware. It functioned the same as the newer usb programmer.

I found a hex file that I compiled a couple weeks ago and it loads and runs fine on the board. However, the same program now compiles with no errors and it says that it successfully loads, but then nothing.

I can reload the other hex file and wall-ah, back in business. So I'm thinking this is a configuration issue but can't find anything that looks out of place. I pretty much only use this computer for programming and pcb layouts and haven't used it since the last time and it worked.

Thoughts on where to start poking?

Archangel
- 11th December 2008, 03:28
Does it work on 16f chips ? My JDM won't do 18F chips, that's why I bought PICKIT2.

Hylan
- 11th December 2008, 03:49
I don't know about 16F chips. I only have/use the 18f6520 chip. I went back and double checked my .inc folder to make sure it's settings were the same.

The odd thing is I can program a hex file that I compiled 2 weeks ago onto a board and it works fine. I'm pulling the hex file straight from the folder using the MELabs Programmer software. But if I then try to compile and program the same program through the PBP and MicroCode Studio Plus (which I used two weeks ago), it compiles with no errors, and programs with no errors but the code doesn't run???

I can turn around and reload the other program onto the same board and it's fine???

I'm not sure what changed over the last two weeks. I even quized the 5 year old as to whether he "played" on Daddy's computer which he said no and I believe him. No jelly on the keys.

skimask
- 11th December 2008, 04:09
I can turn around and reload the other program onto the same board and it's fine???
By any chance, did one of those 'updates' include updates to PBP?

Archangel
- 11th December 2008, 08:27
So when you program and it does not work, can you read back the hex from the chip and see the information ? How do you select the programmer when you load an old hex? Is that the same way as you load a new hex? Are you sure your programmer is using the correct COM port when called by MCS ? Same programming software in both instances ? Have you tried saving the new hex and then loading it the same way as the old hex? I am just throwing out some troubleshooting ideas, no answer required.

Hylan
- 18th December 2008, 04:04
I'm still fighting with this issue and here's where I'm at.

I uninstalled everything PBP, MPASM, Micro Code Studio Plus and several other IDE's I had loaded a long time ago before getting this thing to work (with much help from everyone here on the forum). And life was good up until a week or so ago!

I then reinstalled everything today and finally got the settings worked out on the programmer. So I'm sort of back to square one and looking for ideas. I can load hex files that I created literally 3 weeks ago fine. However, when I try to recompile the pbp file, nothing!

Now when I say nothing, I mean nothing from the board with the chip. The system says that it assembles and compiles fine with no errors. Then it erases the chip, programs and verify's the load and says it programmed successfully, but does nothing.

So, to summarize. Hex file created weeks ago from a pbp file loads and works fine on chip. Exact same pbp file now, assembles, compiles and loads with no errors, but is like it's not on the chip at all. Hmmm???

The one thing I was looking at on the MELabs site: http://www.melabs.com/support/mpasm.htm
was under the xp section trying to figure out what all should be in this path block? What different things should this be point to? Just to Mpasm location, or should it be pointing to other stuff too? Mine was pointing at a whole lot of nothing, so I did at least point it at the folder where Mpasm.exe is located, but that's it right now. And no change to what I posted above.

I'm grabbing at straws here, has anyone else experienced anything like this?

mackrackit
- 18th December 2008, 10:43
Upload a working hex and a non working hex compiled/assembled from the same code so we can take a look at it. we can ckeck the fuse settings from there.

Hylan
- 18th December 2008, 14:33
Here is a working and non working hex file samples from the same code. Rename file extension to .hex

There is a noticable difference in size of the files. Also, I noticed that on the drop down on the IDC Compile button I've got a couple choices listed:
Picbasic Pro 2.50
Picbasic Pro 2.50B
Picbasic Pro 2.50L

Originally I had two listed, 2.50 and 2.50L and the 2.50L was checked. So I tried checking the 2.50 just to see what would happen and then the 2.50B appeared. I don't know what the differences in these are but thought I'd throw it out there.

mackrackit
- 18th December 2008, 15:29
For what it is worth, The config bits are the same between the two. I have not had time to look any farther yet.

skimask
- 18th December 2008, 16:50
The notworking file has 17176 bytes, the working file has 5590 bytes.
Are you sure about compiling the same program? Doesn't look like it to me...
If the 17176 file was compiled with PBPL, that might make sense since PBPL uses all 32 bit math whereas PBP doesn't.

Acetronics2
- 18th December 2008, 17:15
Hi, Hylan

any chance you post here your source code ???

just us to try to reproduce the probem ...

Alain

Jerson
- 18th December 2008, 17:57
I am a bit confused between your first post and the subsequent one. You indicate that the setup is 2 years old and a 2 week old compile works. IIRC, PBP2.50 is of recent vintage. Is it possible you compiled the working file with another version of PBP prior to 2.50? Is that version still available with you so you can backtrack and rule out the compiler change causing this issue? I would like to look at the listing to see if there's something broken here. If you feel insecure posting your code on the forum, you can PM it to me. Cant promise much, but I am willing to help :)

PS: after loading both files, I can say that you haven't embedded the configuration into your source code. So, you are possibly setting the oscillator wrong. HS instead of XT or otherwise

Hylan
- 18th December 2008, 18:27
Okay, so I looked and it's been less than 2 years. Maybe 2 dog years! I have been using the same version 2.50 the whole time and the same pic 18f6520.
I did look and the use PBPL box was checked in response to Skimask's post. I assembled and compiled with it checked and unchecked and got the same result (nothing).
Attached is the source code.
Is there anything with the path setting under the environmental variables that needs to be set? What all should be in there?
The only thing I have in there now is a pointer to the MPASM, nothing else.
Thank you,
Hylan

Archangel
- 18th December 2008, 19:23
Hi Hylan,
I compiled the source code you posted and got exactly what you posted as working and could not duplicate the nonworking code regardless of how I set my assembler or compiler options. Perhaps your mpasm got corrupted somehow, Maybe a fresh download is in order.

Hylan
- 18th December 2008, 19:35
Joe,
I appreciate it! Can you tell me your settings under your Compile and Program Options?
And any other settings that might be impacting this.
I will unload and reload MPASM and see what happens.
Once I reload MPASM are there any setting changes I need to make there?
Thank you,
Hylan

Ron Marcus
- 18th December 2008, 19:55
I hope it's this easy for you Hylan. Somehow the on screen compile buttons got mixed up on the new version. While I thought I was hitting the compile button, I was hitting the ICD compile button! Thus, bloated code and no workie! I feel kind of stupid, but it is all working fine now!
Let me know,
Ron

Hylan
- 18th December 2008, 22:08
Me thinks I might have done the same thing!

So my story is that there was an auto update that moved the button location and I didn't notice!

My wife thinks I'm an idiot savant but we haven't figured out what I'm good at yet! I'm starting to think she's right...

Thank you to everyone for your time. I learned a lot!
Hylan

mackrackit
- 18th December 2008, 23:19
Me thinks I might have done the same thing!

So my story is that there was an auto update that moved the button location and I didn't notice!

My wife thinks I'm an idiot savant but we haven't figured out what I'm good at yet! I'm starting to think she's right...

Thank you to everyone for your time. I learned a lot!
Hylan
Everyone make mistakes.

See my signature line...That is ...experience talking. :)

Archangel
- 18th December 2008, 23:39
Me thinks I might have done the same thing!

So my story is that there was an auto update that moved the button location and I didn't notice!

My wife thinks I'm an idiot savant but we haven't figured out what I'm good at yet! I'm starting to think she's right...

Thank you to everyone for your time. I learned a lot!
Hylan
Yup! that's exactly what happened, I had to upgrade MCS on this computer to check and the hex exactly matches as compiled using PBL . Great, problem solved. Never call yourself names, too many others, wives, inlaws . . available to do that for you :D


My wife thinks I'm an idiot savant but we haven't figured out what I'm good at yet!
Hylan If you're like me then you are good at keeping her entertained.