Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - Loading Code into Micro

(you are viewing a thread; or go back to list of threads)

Loading Code into Micro (by Richard Herzberger)
I am new to working with micro controllers but am familiar with ladder logic. I love the way LDmicro program works and simulates my code and the learning curve was quite short, but I am having problems getting it to load error free into my PIC processor. I have tried several PIC processors all with no success. The programmer I am using is K150V2, I get the code to compile error free, load the Hex file to the programmer and load it to the PIC but I have yet to get one to run. I use other Hex files created in C++ and they load and run fine. Any help would be appreciated.
Thanks
Thu Jan 13 2011, 09:35:37
no subject (by simon)
post your ld program
Thu Jan 13 2011, 11:51:55
Loading Code into Micro (by Richard Herzberger)
Here is the ld program which compiles fine but will not load. I read through previous posts and found I may need a PICkit2 programmer does that sound correct? I ordered one from DigiKey today, should be here next week. My programmer is quite old and uses software called microbrn, time for a new programmer.
Thu Jan 13 2011, 14:56:48, download attachment 5.0gpm Pump UV System PIC16F819.ld
(no subject) (by David R)
Hi I use PIC kit3 with no problems
Regards
David.
Thu Jan 13 2011, 16:08:32
(no subject) (by Richard Herzberger)
Thanks this is my first micro project. I sort of thought it was my programmer but was not sure, I will have a PIC kit2 next week. I am really impressed with the ease and speed of which I was able to put together a program which even incorporated a ADC.
Thu Jan 13 2011, 17:31:25
no subject (by simon)
hi Richard
i tested your program with a diferent pin configuration and 4mhz clock and is ok .
i used ICD2 clone with MPLAB .
Fri Jan 14 2011, 12:31:32, download attachment 5.0gpmPumpUVSystemPIC16F819_2.ld
no subject (by simon)
fuse setup
Fri Jan 14 2011, 12:48:09, download attachment untitled.7z
Help Please (by Richard Herzberger)
I received the PIC kit2 and the 18 pin Demo Board. I am trying to program a PIC16F819. I was able to install the HEX code with no errors but the the program does not run in the microcontroller, I am sure it is a configuration bit problem, The configuration bits are set to 3F42.
Wed Jan 19 2011, 16:05:53, download attachment Flash LED On Hex PIC16F819.hex
(no subject) (by David R)
Hi Richard,
please post the .ld file and the schematic of the demo board.
have never had any problem with any chip not running.
The fusees are set by ldmicro and are correct for most jobs.
What is the supply voltage on the demo board?
Wed Jan 19 2011, 16:49:31
no subject (by simon)
Richard try this hex, is set for 1mhz internal oscilator and blink a led on B0 pin ( anod of LED to B0 and catod to gnd ) .
After programing the pic exit from reset mod of programmer or disconect the programmer from your board .
And what cristal you have on board ? Try with a 4mhz cristal .
My hex should work becose uses internal clock ,and need to conect a 10k resistor to Mclr pin and 5vcc .
Wed Jan 19 2011, 17:10:10, download attachment 819LED.hex
LD file (by Richard Herzberger)
Sorry I downloaded the HEX file and not the LD file.
Wed Jan 19 2011, 17:33:44, download attachment LED Flash.ld
(no subject) (by David R)
Hi the first thing have changed the program to remove the input and hard turn on one led.

Can you post the demo board schematic.

Regards
David
Wed Jan 19 2011, 18:23:50, download attachment LEDFlash_mod_test.ld
(no subject) (by Richard Herzberger)
Simon and David thanks for your help, when I used the configuration bits from your example 3FF8 it worked although the timing is off by a factor of about 100. I should mention I am using a Mac and running Windows XP through Parallels program. I will have to locate a Windows machine and see if that makes a difference. The 18 pin demo board is the only one I can not locate a users guide for. But the LED's are connected to RBO, RB1, RB2 & RB3, this is a board sold by Microchip.
Thank you for your help
Wed Jan 19 2011, 20:33:57
no subject (by simon)
Hi

Probably your schematic is this . Please ceck if is true .
Thu Jan 20 2011, 16:50:15, download attachment DM164120-4 Schematics.7z
(no subject) (by David R)
Have you set up the connections for the crystal?
I see in the schematic the crystal is 10 Mhz
and you have it set up as 4MHz in the program?.

I would be 99% sure the problem is the wiring of the crystal and is "RA5" pulled high ie jp5 connected and the switch open.
Regards
David
Thu Jan 20 2011, 18:12:50
(no subject) (by Richard Herzberger)
Thank you for your help guys, the problem was in the configuration bits, it looks as though the zero position is not used in the clock settings. Once I set the clock configuration bits to positions 1-3 it worked.I also was able to get the code to work in a PIC16F886 with internal clock. The timing is now perfect.
Tue Feb 1 2011, 10:15:54
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):