Maker Pro
Maker Pro

Linker files

Devnode

Jul 13, 2015
94
Joined
Jul 13, 2015
Messages
94
Hi, all.
Can anyone help me on how to add linker files in mplab8. Ive tried everything. I bought a couple of 16f628 pics and there are no linker files to add.
Please help i dont know what to do.
Thnx in advance.
 

Old Steve

Jul 23, 2015
734
Joined
Jul 23, 2015
Messages
734
Hi, all.
Can anyone help me on how to add linker files in mplab8. Ive tried everything. I bought a couple of 16f628 pics and there are no linker files to add.
Please help i dont know what to do.
Thnx in advance.
This might or might not help. I only use MPLAB 6.6, (XP), still, but with my installation the linker scripts can be found here:-
C:\Program Files\MPLAB IDE\MCHIP_Tools\LKR
My LKR directory includes the 16F628.lkr, 16F628A.lkr and 16F628ai.lkr files. They were part of the original install.

To add a linker script file, in the 'Project' pane (V6.6), all that's needed is to right-click on 'Linker Scripts', then click 'Add Files' and browse to the required *.lkr file. Hopefully V8 is similar in this regard.
 
Last edited:

Devnode

Jul 13, 2015
94
Joined
Jul 13, 2015
Messages
94
This might or might not help. I only use MPLAB 6.6, (XP), still, but with my installation the linker scripts can be found here:-
C:\Program Files\MPLAB IDE\MCHIP_Tools\LKR
My LKR directory includes the 16F628.lkr, 16F628A.lkr and 16F628ai.lkr files. They were part of the original install.

To add a linker script file, in the 'Project' pane (V6.6), all that's needed is to right-click on 'Linker Scripts', then click 'Add Files' and browse to the required *.lkr file. Hopefully V8 is similar in this regard.
Hi, Steve.
Thnx for the fast response. Yes i did try the project pane the way you explain except there are no lkr files at all. I'll try it the other way as soon as i get back to my pc and let you know.
Caio for now.
Devnode.
 

Minder

Apr 24, 2015
3,478
Joined
Apr 24, 2015
Messages
3,478
I am using MPLAB IDE 8.92 and it came with all the linker files.
Mine were loaded in C:/Program files/Microchip/MPASM Suite/LKR
Do a search in the MPLAB dir.
M.
 

Devnode

Jul 13, 2015
94
Joined
Jul 13, 2015
Messages
94
I am using MPLAB IDE 8.92 and it came with all the linker files.
Mine were loaded in C:/Program files/Microchip/MPASM Suite/LKR
Do a search in the MPLAB dir.
M.
Thanx, Minder.
Will do that as soon as i get home and let you guys know.
So long.
Dev.
 

Devnode

Jul 13, 2015
94
Joined
Jul 13, 2015
Messages
94
I did find the linker files where you guys said i would but i still cant build my project. Maybe because i copied the code from a 16f84 project and use it here or maybe i type it wrong. I tried to uploud the msg i got but it seems the server is acting up again. Will do at a later stage though.
Thanx for the help so far. Ive learned a lot from you.
Be blessed.
 

Old Steve

Jul 23, 2015
734
Joined
Jul 23, 2015
Messages
734
I did find the linker files where you guys said i would but i still cant build my project. Maybe because i copied the code from a 16f84 project and use it here or maybe i type it wrong. I tried to uploud the msg i got but it seems the server is acting up again. Will do at a later stage though.
Thanx for the help so far. Ive learned a lot from you.
Be blessed.
You'll need to alter the code for the 'F628. I haven't used one for a while, but from memory you need to set a register to disable the A-D converter and use those pins as normal IO. Also, you'll need to include the 'F628 header instead of the 'F84 one. Sorry, that last line isn't relevant. I usually use PICBasic Pro inside the MPLAB IDE. I don't think the xxx.inc header needs to be explicitly included with C.
 
Last edited:

Devnode

Jul 13, 2015
94
Joined
Jul 13, 2015
Messages
94
You'll need to alter the code for the 'F628. I haven't used one for a while, but from memory you need to set a register to disable the A-D converter and use those pins as normal IO. Also, you'll need to include the 'F628 header instead of the 'F84 one. Sorry, that last line isn't relevant. I usually use PICBasic Pro inside the MPLAB IDE. I don't think the xxx.inc header needs to be explicitly included with C.
Thnx, Steve. Will do that and tell you the results later. You have a nice day.
 

Devnode

Jul 13, 2015
94
Joined
Jul 13, 2015
Messages
94
Hi, Steve. I been away from my pc since my last visit. I found the lkr files, built, simulated successfully my code but nothing happens in reality. I uploaded my code for members' scrutiny and help. Dont know what ive done wrong. Any advice?WP_20150926_21_03_12_Pro.jpg
 

Old Steve

Jul 23, 2015
734
Joined
Jul 23, 2015
Messages
734
Hi, Steve. I been away from my pc since my last visit. I found the lkr files, built, simulated successfully my code but nothing happens in reality. I uploaded my code for members' scrutiny and help. Dont know what ive done wrong. Any advice?
:eek: Assembly. :eek:
I'm not really very good with assembly these days. Far too laborious. I work with C or PICBasic in MPLAB. My eyes aren't up to seeing it like that, either.

I'll still see if I can spot anything, though, or someone else might also be able to help if it's easier to read. I could simulate and/or run it in a chip and see if I can figure out what's wrong, too, if I can copy and paste it.
I have 'F628s here.

There's a toolbar button at the top of the edit window, 4th from the right, pops up an "Insert" tooltip. When you click on it, there's a 'Code' option. If you copy your code, then paste it there it'll be far easier to see. We'll go from there.....
 

Devnode

Jul 13, 2015
94
Joined
Jul 13, 2015
Messages
94
:eek: Assembly. :eek:
I'm not really very good with assembly these days. Far too laborious. I work with C or PICBasic in MPLAB. My eyes aren't up to seeing it like that, either.

I'll still see if I can spot anything, though, or someone else might also be able to help if it's easier to read. I could simulate and/or run it in a chip and see if I can figure out what's wrong, too, if I can copy and paste it.
I have 'F628s here.

There's a toolbar button at the top of the edit window, 4th from the right, pops up an "Insert" tooltip. When you click on it, there's a 'Code' option. If you copy your code, then paste it there it'll be far easier to see. We'll go from there.....
Will do so. Just gimme a few hours. Duty calls. Thanx in the meantime.
 

Old Steve

Jul 23, 2015
734
Joined
Jul 23, 2015
Messages
734
I might have seen something already, but I'll wait until I can see the code properly.

Describe the fault a little more clearly, too, if you can please. (A schematic would help heaps as well. Might be a hardware problem.)

Does it do absolutely nothing at all? ie No indication that it's even running?
A startup LED flash is a good idea, to indicate that the program is actually running.
Anyway, I'll check it out better when you get a chance to copy/paste it later on.....
 

Devnode

Jul 13, 2015
94
Joined
Jul 13, 2015
Messages
94
I might have seen something already, but I'll wait until I can see the code properly.

Describe the fault a little more clearly, too, if you can please. (A schematic would help heaps as well. Might be a hardware problem.)

Does it do absolutely nothing at all? ie No indication that it's even running?
A startup LED flash is a good idea, to indicate that the program is actually running.
Anyway, I'll check it out better when you get a chance to copy/paste it later on.....
Will do that, Steve.
 

Old Steve

Jul 23, 2015
734
Joined
Jul 23, 2015
Messages
734
I was gonna suggest the CMCON lines, but you've done it. I'll wait........
 

Old Steve

Jul 23, 2015
734
Joined
Jul 23, 2015
Messages
734
You might not need to copy & paste. I think it should work if I'm getting the picture correctly.

If your reed switch has a pullup resistor and goes low when the magnet is in place,
and
if your switch has a pulldown resistor and goes high when it's on,
and
if the LED is connected between it's pin and ground,
and
if the alarm is connected between it's pin and ground,
then
with the magnet in place on startup, your code should jump straight to "Ready" and light the LED.

From there,
if/when the switch is on, (high), it should go straight to "Alarm Sense" and loop until the magnet is away from the reed, (pin high), provided the switch is still on.
Then, when the magnet is away, it re-tests the switch and if it's still on, (high),
it should go to "Set alarm", turn the alarm on, then loop until the switch is turned off, (low).
When the switch is turned off, it should go straight back to "Reset", turn the LED and alarm off,
and loop at "Main" waiting until the reed switch is closed, (magnet in place), again. Once it's closed, (low), it should light the LED and wait for the switch to be turned on, (high) and do it all again ad infinitum.

So, in summary, I see nothing wrong with the software, if the connections are as I described.
It should work. I might have overlooked something, but I don't think so.
I think you must have a hardware problem.

You could add a LED flash at startup, as mentioned, to ensure that the chip is OK and the program is actually running.

Edit: If you still can't see anything wrong at that point, copy and paste your code here and I'll burn it into a chip, set up the circuit, and test it independently. If it works here, you'll know for sure it's a hardware problem. I've even got some reed switches here that are ready to go.
Actually, check your reed switch in operation with a magnet and continuity test on your DMM, too. Make sure it's closing OK when the magnet's within range.

Just one other thing - in your code comments, you say reed switches, not reed switch. You can't have multiple, parallel reed switches with this program, of course, or it wouldn't work. You could have multiple series reed switches though.
 
Last edited:

Devnode

Jul 13, 2015
94
Joined
Jul 13, 2015
Messages
94
You might not need to copy & paste. I think it should work if I'm getting the picture correctly.

If your reed switch has a pullup resistor and goes low when the magnet is in place,
and
if your switch has a pulldown resistor and goes high when it's on,
and
if the LED is connected between it's pin and ground,
and
if the alarm is connected between it's pin and ground,
then
with the magnet in place on startup, your code should jump straight to "Ready" and light the LED.

From there,
if/when the switch is on, (high), it should go straight to "Alarm Sense" and loop until the magnet is away from the reed, (pin high), provided the switch is still on.
Then, when the magnet is away, it re-tests the switch and if it's still on, (high),
it should go to "Set alarm", turn the alarm on, then loop until the switch is turned off, (low).
When the switch is turned off, it should go straight back to "Reset", turn the LED and alarm off,
and loop at "Main" waiting until the reed switch is closed, (magnet in place), again. Once it's closed, (low), it should light the LED and wait for the switch to be turned on, (high) and do it all again ad infinitum.

So, in summary, I see nothing wrong with the software, if the connections are as I described.
It should work. I might have overlooked something, but I don't think so.
I think you must have a hardware problem.

You could add a LED flash at startup, as mentioned, to ensure that the chip is OK and the program is actually running.

Edit: If you still can't see anything wrong at that point, copy and paste your code here and I'll burn it into a chip, set up the circuit, and test it independently. If it works here, you'll know for sure it's a hardware problem. I've even got some reed switches here that are ready to go.
Actually, check your reed switch in operation with a magnet and continuity test on your DMM, too. Make sure it's closing OK when the magnet's within range.

Just one other thing - in your code comments, you say reed switches, not reed switch. You can't have multiple, parallel reed switches with this program, of course, or it wouldn't work. You could have multiple series reed switches though.[/QUOTE. Hi Steve. I took a quick peek at my h/ware and found that i had a pullup R on my switch which i changed promptly but without any change to the ststus quo. I will later test all the other stuff like reedswitches etc. I got home around 3am after your last reply so i didnt sleep much. Have to get ready for church now so ill get back to you a bit later. Dont know what time it is over there, of course. Caio for now.
 

Devnode

Jul 13, 2015
94
Joined
Jul 13, 2015
Messages
94
Hi Steve. I took a quick peek at my h/ware and found that i had a pullup R on my switch which i changed promptly but without any change to the ststus quo. I will later test all the other stuff like reedswitches etc. I got home around 3am after your last reply so i didnt sleep much. Have to get ready for church now so ill get back to you a bit later. Dont know what time it is over there, of course. Caio for now.
 

Old Steve

Jul 23, 2015
734
Joined
Jul 23, 2015
Messages
734
Hi Steve. I took a quick peek at my h/ware and found that i had a pullup R on my switch which i changed promptly but without any change to the ststus quo. I will later test all the other stuff like reedswitches etc. I got home around 3am after your last reply so i didnt sleep much. Have to get ready for church now so ill get back to you a bit later. Dont know what time it is over there, of course. Caio for now.
It was about lunchtime here when you replied.
That pullup resistor wouldn't have helped, since your code relies on the opposite.
Let me know how you go.
(And try adding that LED flash on startup. I always do. It's pretty useful.)
 
Last edited:

Devnode

Jul 13, 2015
94
Joined
Jul 13, 2015
Messages
94
How did you go? Find the problem?
Hi, Steve. Sorry to come back only now but we`ve had some internet problems here at home. However the problem persists. i`ll try to upload my code for you to see. Thanks in advance. Dev. Seems i still cannot upload so i`ll have to try another way.
 
Top