Hi all,
I'm relatively new to PICs, but have used it before with colleagues. Now I am on my own, and I'm stuck with very basic programming. I have overall knowledge of PICs, and general programming or electronics should not be a problem.
Now i have built my own serial programmer (Programming the PIC16F84 with Linux), went to linux with both sdcc, gpasm, gpsim and picprog, and tried to program my 16F684A to do some led toggles based on elementary programs stealing power from this same programmer, but a no-go. And yes, I get 5V across Vss and Vdd (in fact 5.5V but I dont trust my volt meter precision).
Things i tried: a) putting a led from vpp to /MCLR so it now reads 5.0V
b) toggling portb2, portb3 and porta(various) so it should not conflict with the programmer
c) changing all references from 16F427 to 16F468A, because the original program had these info.
Now my concern is tracking the problem, so I can tell whether the chip is not alive, not working, not programmed, etc.
Here it is what it does: I read 0V at all portA, portB0~3, and -0,25V (yes, minus) at portB4, independent of the setting of output to any of this pins. From this I can understand that the chip is not driving the outputs, or else it should show at least 0,2V as any TTL would do. And, if toggling as it should, I expect it to be at least 1V
Also, 0V from osc1 and osc2. Does that mean the internal clock is NOT working?
When I read the program, it is different from the .hex file I have compiled (#cmp says 'differ: byte 3, line 1'), but when I change the program and compare to a previous that i rode before, it tells me like 'differ: byte 10, line 1', so I am not suspecting problems with usage of the programmer i built.
Should I try powering externally without the programer plugged in? What is the most basic electronical test that I can do to tell if the most basic program is working, or at least the CPU is running? All i have is a pair of transistors, leds, resistors, and a volt meter.
I am thinking about buying an 16F427 or 16F84, they seem more popular to get elementary code to test on. Should it help me?
Is there a way to debug the chip while it is running? So at least I know it is ticking inside?
Thanks
=========================
main
bsf STATUS, RP0 ; Select Bank 1
bcf TRISA ^ 0x080, 0x1 ; Enable RB1 for Output
bcf STATUS, RP0 ; Select Bank 0
toggle
bsf PORTA, 1
bcf PORTA, 1
goto toggle
I'm relatively new to PICs, but have used it before with colleagues. Now I am on my own, and I'm stuck with very basic programming. I have overall knowledge of PICs, and general programming or electronics should not be a problem.
Now i have built my own serial programmer (Programming the PIC16F84 with Linux), went to linux with both sdcc, gpasm, gpsim and picprog, and tried to program my 16F684A to do some led toggles based on elementary programs stealing power from this same programmer, but a no-go. And yes, I get 5V across Vss and Vdd (in fact 5.5V but I dont trust my volt meter precision).
Things i tried: a) putting a led from vpp to /MCLR so it now reads 5.0V
b) toggling portb2, portb3 and porta(various) so it should not conflict with the programmer
c) changing all references from 16F427 to 16F468A, because the original program had these info.
Now my concern is tracking the problem, so I can tell whether the chip is not alive, not working, not programmed, etc.
Here it is what it does: I read 0V at all portA, portB0~3, and -0,25V (yes, minus) at portB4, independent of the setting of output to any of this pins. From this I can understand that the chip is not driving the outputs, or else it should show at least 0,2V as any TTL would do. And, if toggling as it should, I expect it to be at least 1V
Also, 0V from osc1 and osc2. Does that mean the internal clock is NOT working?
When I read the program, it is different from the .hex file I have compiled (#cmp says 'differ: byte 3, line 1'), but when I change the program and compare to a previous that i rode before, it tells me like 'differ: byte 10, line 1', so I am not suspecting problems with usage of the programmer i built.
Should I try powering externally without the programer plugged in? What is the most basic electronical test that I can do to tell if the most basic program is working, or at least the CPU is running? All i have is a pair of transistors, leds, resistors, and a volt meter.
I am thinking about buying an 16F427 or 16F84, they seem more popular to get elementary code to test on. Should it help me?
Is there a way to debug the chip while it is running? So at least I know it is ticking inside?
Thanks
=========================
main
bsf STATUS, RP0 ; Select Bank 1
bcf TRISA ^ 0x080, 0x1 ; Enable RB1 for Output
bcf STATUS, RP0 ; Select Bank 0
toggle
bsf PORTA, 1
bcf PORTA, 1
goto toggle