View previous topic :: View next topic |
Author |
Message |
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
12F683, GP2 won't toggle [SOLVED] |
Posted: Sun Jan 18, 2015 6:20 pm |
|
|
OK what silly thing have I missed trying to get GP2 to blink?
This is driving me nuts. PCM4.110. All other pins are good to go.
Using Picstartplus as Pickit3 doesn't like the 683 (something about mclr, internal clock) that's a 'side issue'. Have tried 2 PICs.
Code: |
// 12F683test
//
#include <12f683.h>
#fuses INTRC_IO,NOWDT,PUT,NOPROTECT,NOMCLR
#use delay(clock=4000000) // 4MHz xtal
#define led0 pin_a0
#define led1 pin_a1
#define led2 pin_a2
#define led4 pin_a4
#define led5 pin_a5
//=============================================================================
void main(){
setup_oscillator(OSC_4MHZ); //internal 4 MHz osc 12f683
setup_comparator(NC_NC_NC_NC); //no comparators
setup_adc_ports(no_analogs); //no adc inputs
setup_adc(adc_off); //no adc
setup_timer_1(T1_disabled); //no timer
setup_ccp1(ccp_off); //no ccp
disable_interrupts(global); //no interrupts
delay_ms(500); // startup delay of .5 seconds
do {
output_toggle(led0);
output_toggle(led1);
output_toggle(led2);
output_toggle(led4);
output_toggle(led5);
delay_ms(450);
}while (TRUE);
}//end of main================================================================= |
maybe I'm getting too old for this ??
thanks
Jay
Last edited by temtronic on Mon Jan 19, 2015 6:50 am; edited 1 time in total |
|
|
Jerson
Joined: 31 Jul 2009 Posts: 125 Location: Bombay, India
|
|
Posted: Sun Jan 18, 2015 6:55 pm |
|
|
Can you try by turning on the internal weak pull-ups? Possibly the R-M-W problem. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Mon Jan 19, 2015 6:50 am |
|
|
finally it blinks! the Macro seems to have done it !! Though the amount of time spent is crazy compared to using an 18 pin PIC, sure hope the client wants more than 100 units.
Both my original white case PS+ and the flashed black case PS+ work fine, might tackle the PK3 nonsense later...
thanks
see you can teach an old dog new tricks!
Jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19510
|
|
Posted: Mon Jan 19, 2015 9:35 am |
|
|
As you will see in my reply your thread about programming, it is a _chip_ limitation. Nothing the PIcKit3 can do about it.
It can be programmed in any programmer that has control over the Vdd line. |
|
|
|