illegal121
Member level 2
- Joined
- Jun 20, 2011
- Messages
- 49
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Location
- Oman
- Activity points
- 1,650
unsigned int temp_res;
unsigned int temp_res1;
char buf2[6];
char buf[6];
int i;
void main() {
UART1_Init(9600);
delay_ms(100);
TRISA = 0xFF;
CMCON = 0x07;
TRISA = 0xFF; // PORTA is input
TRISC = 0; // PORTC is output
TRISB = 0; // PORTB is output
do {
temp_res = ADC_Read(0); // Get 10-bit results of AD conversion
PORTB = temp_res; // Send lower 8 bits to PORTB
PORTC = temp_res >> 8; // Send 2 most significant bits to RC1, RC0
temp_res1=ADC_read(1);
WordToStr(temp_res,buf2 );
for(i = 0; i < 6; i++)
{
UART1_Write(buf2[i]);
Delay_us(2);
}
UART1_Write(13);
WordToStr(temp_res1,buf );
for(i = 0; i < 6; i++)
{
UART1_Write(buf[i]);
Delay_us(2);
}
}
while(1);
}
I am using MikroC compiler
@bigdogguru
What do u mean by "in its entirety" ..? this is my full complete code so far ..
(As I had searched out in Google that many PIC cant properly work at 20Mhz oscillator they need 4Mhz oscillator , true ... ? :S )
Yes , As you said about all configuration setting i keep the same configurations..
and ICprog also verified my code successfully after programming ..
you are talking about debugger mode in ICprog software...?
yes .. You are talking about this one rite... ?
PORTB = ~PORTB;
while(1);
try to disable the LVP(low voltage programming).
I have a experience with that also but I dont know my PIC did not work because of that.. hehee
why is it bigdogguro ??
hey see whats happening .. I make a program which send high then low for 6 times on port B..
Without oscillator it is not working at all .. When i connect oscillator , during connecting time LEDes blinked very sharply but after that some are blinking and some are not (still OSC is connected)..
hey see whats happening .. I make a program which send high then low for 6 times on port B..
Without oscillator it is not working at all .. When i connect oscillator , during connecting time LEDes blinked very sharply but after that some are blinking and some are not (still OSC is connected)..
It could possibly be due to the programmer you are using. I do not have an issue with it and the ICD2 or ICD3.
Are you using a ICProg as well Romel?
BigDog
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?