![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| PIC Programing / Design Discuss programing of PIC chips here and design of electronics using PIC chips. |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
| After getting a circuit to work that was a nightmare dead bug mess, I found miniaturizing it wasn't going to work. I decided to learn programming with A Beginner's guide to Embedded C. I also picked up a PICkit 2. 1. MPlabs has changed some of the programs and the new choice names during Install left me doubting I had installed it right. It works with Code from the example project files, but I can copy by eye write the entire code using a screen magnifier so there is no doubt all the right characters are in place, yet my builds fail. This is using the pallet in the MPlab. They say why, but no line # where the failure is, but line by magnified line ahows nothing amiss. Some make no sense saying a character is either there or missing. I've tried a Copy/Paste of the working project code verbatim, but it doesn't build that way either. Modifying a working program works about half way now(adding LEDs and changing time values, but not adding and if/then statement). My eyes aren't the best so I tried using Word 03, but those builds failed. Remembering I had the same problems with Gcode and Word, I tried Wordpad and saving as DOS, stripping all formating, and still I can't write and save/import a working code. Even a copy/save of existing projects examples won't work. I can understand importing formatted text causing problms, but a copy/paste within MPlab isn't working either. Would Ubuntu be a better OS for PIC programming? I'd like to know what kind of text writing program works that will let me use an enlarged text size, without adding hidden headaches to the code. I'd like to add another few buttons and more LEDs. All those holes in the development board, do they make reusable pins with wires, or are are you suppoosed to solder wires directly to the board? The fifth project shows the Vdd holes on the board on my board as having pins and a jumper. Am I supposed to solder pins, then use a jumper? Can I just take a small loop of project wire and connect the two holes without soldering?. And last, if they sell those header pins that'd go in the holes for the jumper, where do you get them? Thanks! Bill |
|
#4
| |||
| |||
|
Fortunately, because "pics aren't good for that" ![]() What PIC are you using? Have you looked into hitech C? I only mention it because it is what I use and it is free. I have a fair amount of simple code I could share if you use the same compiler as I am. I work with Hitide and Hitech's compilers for baseline and 18 series pics. I have recently started using MPLAB for dsPIC but I have not used it much. www.htsoft.com It can be really frustrating trying to track down little bugs, I'm not very good at it either and the error messages are sometimes cryptic at best. I have never tried writing code in anything other than an IDE, the lack of color codes and whatnot makes it too irritating for me top even try. Maybe there is some setting to increase the font size within MPLAB? If you aren't afraid to hop over to Hitide (or at least a hitech compiler) I can share some code with you that might flatten out the learning curve a bit. I use the pickit 2 as well so it should work for you if it works for me. You can get almost any electronic component you could ever want from several places: www.digikey.com ($25 minimum or $5 handling charge) www.mouser.com (no minimum) www.newark.com Post some more details about what hardware you have and what you are trying to do and we can go from there. Matt |
|
#5
| |||
| |||
| I'm using MPlab with Hitec compiler. I'm using Beginner's Guide to Embedded C by Chuck Hellebuyck nd he uses both in the book. It's well written and understandable for a raw newbee. The PIC I'm programming at the moment is a 16F690 that came with low pin count development board. What I want to do is have four inputs. Two momentary that start and stop a function, and two that hi/low to make a function work or not. The two momentary inputs each start two five LED arrays that sequence from one to all on and two LEDs piggiy backed one to each array. These two LED arrays will only blink on and off, while the sequence program cycles. Both will cycle for so many runs before auto turning off, canceled by a second momentary input, or canceled by having the other input activated. Only one array is sequencing at any time that it is called to. The third input that will be either low or high flashes all LEDs on and off. It has precedent over the first two inputs. When the fourth is activated, it turns on whichever array isn't sequencing, or all the sequenced LEDs go on if none were working. If a sequenced array is called up, it has precedence over the lighted array. The fourth input also is Master over the third input array flasher. Basically a multi-segmented rear turn signal that sequences the direction turn. Brakes activate inactive turn signal as a brake light or all if no signal is on. Turn signal lights it's array even if the brake lights are on so a turn can be shown. The flashing is for the Emergency Flashers, and the two single LED outputs are for front/indicator LEDS. I've got the array code done, and the flasher code. I'm working on which has top billing and when, plus getting the inputs ro work as I want them to. At the moment I'm waiting for headers to come in so I can adapt my demo board to a project board. When I'm done with this one I'm going to do a simpler one of just flash/off or on/off depending on input. A 8 pin PIC will be perfect for that. |
| Sponsored Links |
|
#6
| |||
| |||
I use MPLAB with C18 but when I did more PIC16 chips I used HiTech C compiler. It sounds like you've made more progress, are you still stuck at compiling? |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CNC mill questions - thrust bearings, leadscrew mounting, general questions | tonofsteel | DIY-CNC Router Table Machines | 8 | 02-03-2012 03:42 PM |
| Newbie- PICkit 2 mod for program higher pin count | oxford | PIC Programing / Design | 8 | 01-26-2009 10:32 AM |
| horn pin (angled pin) | spider | Moldmaking | 6 | 09-29-2007 07:37 AM |
| A few general newbie questions | sigipa | General Metalwork Discussion | 4 | 08-21-2007 03:41 PM |
| General CNC questions | dmparrott | DIY-CNC Router Table Machines | 1 | 01-24-2007 08:16 PM |