tpetar
Advanced Member level 7
- Joined
- Sep 27, 2010
- Messages
- 6,417
- Helped
- 1,713
- Reputation
- 3,456
- Reaction score
- 1,673
- Trophy points
- 1,393
- Location
- Pancevo-Belgrade, Serbia
- Activity points
- 37,363
that means, i selected P18f46K22 in MikroC Pro 5.6, and same PIC in Proteus, but its not working properly with GLCD.
>P18f46K20 is working perfect in both (problem is 46k20 is 3.3 v device, and ram is low), i cant continue with 46k20
is real hardware perfectly works with 46K22???
and i did speed sensors & ADC, its working, thanx :smile:
i did speed sensors & ADC, its working, thanx :smile:
1) so im using k20 for simulation purpose, cade can be transformed to k22 rit??
>means both are different, 1) external pulse counter & 2) ADC in 46k20 with GLCD, its working fine
is there any pins or bits or any rgister differences in K20 to K22?
x = (256*TMR0H + TMR0L);
temp=((0.0018)*x)/12;
temp1+=temp;
now i try with MikroC, if its fails i have to create own routines,
may be KS0108, which is largely available in market.
is there any floating roundup calculation problem with pic??,
i need to calculate
x = (256*TMR0H + TMR0L);
temp=((0.0018)*x)/12;
temp1+=temp;
showing less numbers
/********************************wheel sensor*************************************/
{
T0CON.TMR0ON = 1;
TMR0L = 0;
TMR0H = 0;
Delay_ms(500); // Wait for 1 sec
T0CON.TMR0ON = 0; // Stop the timer
temp = (256*TMR0H + TMR0L);
{
temp1= (temp*2*6.732)/12; //used 12 magnets for 1 wheel rotation, wheel base is 1.88m and multiplied with kM/one hour reading ((60*60)/1000) finally 1.88*3.6=6.732
speed_value[2] = (unsigned char) (temp1/100);
speed_value[1] = (unsigned char) ((temp1/10)-(speed_value[2]*10)); // Find out second digit
speed_value[0] = temp1-(speed_value[2]*100)-(speed_value[1]*10);
if (temp1>99)
{
Glcd_Set_Font(Font_Glcd_Character8x7, 8, 7, 32);
Glcd_Write_Char((speed_value[2] + 48),2,2,1);
Glcd_Write_Char( (speed_value[1] + 48),9,2,1);
Glcd_Write_Char( (speed_value[0] + 48),16,2,1);
}
else
{
Glcd_Set_Font_Adv (Forgotten_Futurist12x19,1,0);
temp4=temp1 ;
Glcd_Write_Char_Adv( (speed_value[1] + 48),3,10);
Glcd_Write_Char_Adv( (speed_value[0] + 48),16,10);
}
#endif
}
Glcd_Set_Font(Font_Glcd_System5x7, 5, 7, 32);
temp2=((temp*(1.88/1000))/12); //same, for 1 rotation 12 pulses, so total is temp2
temp3=temp3+temp2;
Digit[3]= (float) (temp3/100);
EEPROM_Write(0x00,Digit[3]);
Delay_ms(10);
Digit[2]=(float)((temp3/10)-(Digit[3]*10));
EEPROM_Write(0x01,Digit[2]);
Delay_ms(10);
y=(float) (temp3 - (Digit[3]*100)-(Digit[2]*10));
Digit[1]=(char) y;
EEPROM_Write(0x02,Digit[1]);
Delay_ms(10);
x= y*10;
Digit[0]=(char) (x -Digit[1]*10);
EEPROM_Write(0x03,Digit[0]);
Delay_ms(10);
Glcd_Write_Char((Digit[3] + 48),3,6,1);
Glcd_Write_Char( (Digit[2] + 48),11,6,1);
Glcd_Write_Char( (Digit[1] + 48),19,6,1);
Glcd_Write_Text(".",26,6,1);
Glcd_Write_Char( (Digit[0] + 48),34,6,1);
}
in that library site, they not mentioned pic18??
this code i have used foe speed measurement & odo reading
result is, speed = 60 Km/h , duration 1 min. i need to get 1km in odometer
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?