You have read the code and copied it? What about the eerom and configuration bits?
It is quite possible the code loads preset information from eerom, and certainly the configuration bits need to be the same, else chip will function differently.
Hi To All,
I have had my CNC stored away for about a year and a half. I took it back out to continue working and found two axises not working. After doing all the testing of boards and circuitry, I came to the conclusion that new PIC16F628A were needed.
Here's the current scenario:
1. Of the 3 original chips, 1 still works. The other 2 dead.
2. When I put the working chip into the other motor drivers the drivers function as they should.
3. Purchased 3 new chips, burned them and verified the data.
4. Placed new chips into the drivers and they don't step properly.
5. Removed new chip from one driver and put the working old chip into driver, still works as it should.
I never seen anything like this in my life. Does anyone out there have a clue what's going on here or have another procedure to detect problem?
Thanks Crawford
Similar Threads:
You have read the code and copied it? What about the eerom and configuration bits?
It is quite possible the code loads preset information from eerom, and certainly the configuration bits need to be the same, else chip will function differently.
Super X3. 3600rpm. Sheridan 6"x24" Lathe + more. THREE ways to fix things: The RIGHT way, the OTHER way, and maybe YOUR way, which is possibly a FASTER WRONG WAY!
Hi neilw20,
Yes I copied the code from good chip, but was not aware of chip configuration. I'll look more into it. I'm not a programmer by any stretch of the imagination. Will give it a whirl. I get back to you.
Thanks a lot
Crawford
Hi,
If anyone can shed some light on the subject of chip programming, I might be able to solve my problem. After burning the chips again, using the Ozipicer programmer hardware and Oshunsoft programming software, I was able to burn a chip successfully. I need help programming it correctly. I now have motors that respond when toggled by vibrating with out completing a step in either direction. So my thinking is that I'm not burning the chip with the correct settings. Can someone help.?
Thanks in advance
Cpete
I just us the Microchip programmer and MPLAB environment and all the following is taken care of for me.
Your programming software needs to be able to read and write 3 areas.
1. Program: 0x00 to 0x1F
2. Configuration Register at 0x2007 - also in DS41196 below.
3. EEPROM: go to microchip web site.
For complete details of serial programming, please refer to “PIC16F627A/628A/648A EEPROM Memory Programming Specification”(DS41196).
An algorithm needs to be used to read the EEPROM data from original chip. It is not memory mapped, to the outside world.
If the following bits not stored in your setup file (usually a .hex - intel format file) then your programming won't be complete. All bits default to 1.
Also..
Additional information on the data EEPROM is available in the PIC ® Mid-Range Reference Manual (DS33023)
item 2..
bit 13: /CP: Flash Program Memory Code Protection bit (note 2) (PIC16F628A)
1= Code protection off
0= 0000h to 07FFh code-protected
bit 12-9: Unimplemented: Read as ‘0’
bit 8: /CPD: Data Code Protection bit (note 3)
1= Data memory code protection off
0= Data memory code-protected
bit 7: LVP: Low-Voltage Programming Enable bit
1= RB4/PGM pin has PGM function, low-voltage programming enabled
0= RB4/PGM is digital I/O, HV on MCLRmust be used for programming
bit 6: BOREN: Brown-out Reset Enable bit (note 1)
1= BOR Reset enabled
0= BOR Reset disabled
bit 5: MCLRE: RA5/MCLR/VPPPin Function Select bit
1= RA5/MCLR/VPPpin function is MCLR
0= RA5/MCLR/VPPpin function is digital Input, MCLRinternally tied to VDD
bit 3: /PWRTE: Power-up Timer Enable bit (note 1)
1= PWRT disabled
0= PWRT enabled
bit 2: WDTE: Watchdog Timer Enable bit
1= WDT enabled
0= WDT disabled
bit 4, 1-0: FOSC<2:0>: Oscillator Selection bits (note 4)
111= RC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, Resistor and Capacitor on RA7/OSC1/CLKIN
110= RC oscillator: I/O function on RA6/OSC2/CLKOUT pin, Resistor and Capacitor on RA7/OSC1/CLKIN
101= INTOSC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN
100= INTOSC oscillator: I/O function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN
011= EC: I/O function on RA6/OSC2/CLKOUT pin, CLKIN on RA7/OSC1/CLKIN
010= HS oscillator: High-speed crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN
001= XT oscillator: Crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN
000= LP oscillator: Low-power crystal onRA6/OSC2/CLKOUT and RA7/OSC1/CLKIN
Notes:
1: Enabling Brown-out Reset does not automatically enable the Power-up Timer (PWRT) the way it does on the PIC16F627/628 devices.
2: The code protection scheme has changed from the code protection scheme used on the PIC16F627/628 devices.
The entire Flash program memory needs to be bulk erased to set the /CPbit, turning the code protection off. See
“PIC16F627A/628A/648A EEPROM Memory Programming Specification” (DS41196) for details.
3: The entire data EEPROM needs to be bulk erased to set the CPDbit, turning the code protection off. See “PIC16F627A/
628A/648A EEPROM Memory Programming Specification” (DS41196) for details.
4: When /MCLR is asserted in INTOSC mode, the internal clock oscillator is disabled.
Last edited by neilw20; 05-14-2014 at 08:01 PM. Reason: typo
Super X3. 3600rpm. Sheridan 6"x24" Lathe + more. THREE ways to fix things: The RIGHT way, the OTHER way, and maybe YOUR way, which is possibly a FASTER WRONG WAY!
This is what I did many moons ago
By using the hex file I didn't have to worry about setting the config bits.
How did you program your chips originally?
I'll get it finished sometime after I start it.....
Seems like the problem wasn't solwed