![]() | |
| 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
| |||
| |||
| PIC16F627A Programming Problem Hello, I'm just getting into programming pic's, and I'm using a pic in my senior design project. I have an issue programming a PIC16F627A, the software has been tested on a PIC16F84, but I would like to use the '627A for the internal oscillator. I'm using an EPIC programmer with a PICBASIC PRO 2.45 compiler, and the MELABS Beta 4.0 loader software. Here is the code (hardly qualifies as programming): output PORTA.0 input PORTA.1 dir1 var PORTA.1 led VAR PORTA.0 loop: LED = DIR1 goto loop end This is just test code I'm trying to get to run, all it is meant to do is turn on an LED on PORTA.0, when I press a switch attached to PORTA.1. Works just fine with the 'F84, all I change is the compiler/loader option from 'F84 to the '627A, and change the configuration file to internal oscillator. I don't change the circuitry from 'F84 to the '627 except for removing the 2 caps and the crystal. With these same changes I can get both to run a simple blink program. Any suggestions and/or advice is greatly appreciated. Thanks, Minesgeek |
|
#2
| |||
| |||
| I'd ask if DIR1/LED is actually the same as dir1/led and could be case sensitive. Second would be if there are any header settings to begin the code at a certain place in memory or clear old/random junk. I have never used these chips or the software you mention, but I have done some large projects with Parallax SX and small ones with Basic Stamp products. DC
__________________ Learn cause and effect through experience. Mastering those relationships is the "Common Sense" ability within the art of any trade. |
|
#3
| |||
| |||
| I believe you forgot to address a few other things first: 1.you have to tell it to use the internal oscillator |
|
#4
| |||
| |||
| Sorry for the erratic post... Try this include in the beginning of your code)@ DEVICE PIC16F627, INT_OSC |
|
#5
| |||
| |||
| Again... This time I won't hit tab Add these lines in the beginning of your code: @ DEVICE PIC16F627 INTRC_OSC_NOCLKOUT 'that tells it to use internal osc CMCON=7 'turn comparators off VRCON=0 'voltage ref disabled This should make it work better Cheers, JR |
| Sponsored Links |
|
#6
| |||
| |||
| JRinAZ/MN, Thanks, I'll try those, actually the programmer can set the chip to internal oscillator, but that code is much better. I just discovered the comparator functions in the data sheet (yeaahh...good idea to read those, huh?). These little chips rock...I just build some stepper drivers for my mill using the L6208, I may be redesigning the whole thing to use a pic chip and the new Infineon H-bridges TLE 5206 (these bridges are nice, check 'em out). Thanks again for all your help! Minesgeek P.S. the caps in my code were my bad..it's case consistent in the program. Does anyone know of any free methods for programming these chips (or extremely cheap < $100)? |
|
#7
| |||
| |||
| If you have a problem with the code, let me know... I write a great deal of PIC code (probably 150 pgms a year) for LCD panels, kiosks, and such.. I've done several unipolar programs for my own amusement.... Cheers, JR |
|
#8
| |||
| |||
| you need to turn off comparator module beacause after a chip reset, the comparator inputs are analog and you won't be able to write on these pins. this is why: CMCON = 0x07; // turn off comparator module BTW, do you know C coding, because on HT-Soft web page http://www.htsoft.com/ you can downlod a free demo C compiler. the only thing is that you are limited to 1k byte of code size(which is a lot sufficient for a stepper driver including current control. You now have the compiler you now need the development environement get MP-LAB IDE from Microchip which is absolutely free on their site : http://www.microchip.com/stellent/id...&part=SW007002 There is project wizards in MP-LAB and you'll find how to select the ht-soft compiler from your MP-LAB project. You won't have to call the compiler separately. Then, to program your chip get on: http://home.vrweb.de/~lotharstolz/st...vpc/index.html. cool hein ?? The 16F627A is LVP (Low Voltage Programming) It'll cost you 4 resistors and a DB9 connector !!! get IC-PROG (the link for ic-prog is on the page of the previous link)questions ?? ask me best regards, nic Last edited by niclatrique; 10-30-2006 at 10:41 PM. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |