CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

why isn't working
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
idris



Joined: 07 Apr 2014
Posts: 16

View user's profile Send private message

PostPosted: Thu Apr 17, 2014 10:14 am     Reply with quote

we fixed thanks every one last code here now ı have to understood how work DS18B20 because is not measuring correctly every moment changing on screen


Code:
#include <18F4550.h>
#device ADC=10

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES PLL1                     //No PLL PreScaler
#FUSES CPUDIV4                  //System Clock by 4
#FUSES INTHS                    //Internal Oscillator, HS used by USB
#FUSES NOFCMEN                  //Fail-safe clock monitor disabled
#FUSES NOIESO                   //Internal External Switch Over mode disabled
#FUSES NOBROWNOUT               //No brownout reset
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOXINST                  //Extended set extension and Indexed Addressing mode disabled (Legacy mode)

#use delay(int=8000000)

#include <HDM64GS12.c>
#include <graphics.c>


//#use fast_io(a)

unsigned long int bilgi, bilgi1;
float voltaj, sicaklik;

char text[];

void main()
{
   setup_psp(PSP_DISABLED);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_timer_3(T3_DISABLED | T3_DIV_BY_1);
   setup_CCP1(CCP_OFF);
   setup_CCP2(CCP_OFF);
   
set_tris_a(0x01);
setup_adc(adc_clock_div_32);
setup_adc_ports(AN0);


glcd_init(ON);
delay_ms(500);
set_adc_channel(0);
delay_us(20);

   while(1)
   {
   bilgi=read_adc();
   delay_ms(10);
   voltaj=bilgi
   sicaklik=voltaj
   delay_ms(20);
   sprintf(text,"%5.2f", sicaklik);
  glcd_text57(1, 1, text, 1, ON);
    delay_ms(10);
    glcd_init(ON);

   }

}
[/code]
temtronic



Joined: 01 Jul 2010
Posts: 9466
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Apr 17, 2014 10:22 am     Reply with quote

You do not have any code or driver for the DS18B20 in your posted program!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Apr 17, 2014 10:26 am     Reply with quote

He is announcing what he is going to do next. His current code works,
so he will next work on DS18B20.
temtronic



Joined: 01 Jul 2010
Posts: 9466
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Apr 17, 2014 2:50 pm     Reply with quote

sorry...been a long day...got forklift stuck in mud and this PC decided to go 'funny',sigh....

there are 'drivers' and working code for the DS18b20 in the code library...

hth
jay
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Thu Apr 17, 2014 4:16 pm     Reply with quote

So Temtronic, you are saying you have a problem with the "driver" for the forklift??? Twisted Evil

mikey
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group