Search found 1544 matches

by paulfjujo
26 Apr 2024 08:03
Forum: mikroC PRO for PIC General
Topic: PIC18F47K42 USING DS1307 CLOCK I2C
Replies: 1
Views: 40

Re: PIC18F47K42 USING DS1307 CLOCK I2C

hello, you can find here all you need to use I2C1 , specific for 18F27K42 ... without mikroC library ... used for OLED display and DS3231 RTC needs to add specific register names, not included in MikroC registres I2C du MCU 18F27K42 sbit I2C1STAT0_BFRE at I2C1STAT0.B7; sbit I2C1STAT1_TXBE at I2C1STA...
by paulfjujo
17 Apr 2024 15:04
Forum: mikroC PRO for PIC General
Topic: can I read two digit number using UART1_Read()?
Replies: 7
Views: 375

Re: can I read two digit number using UART1_Read()?

hello, .....Your code is working fine. but if print number in next line it will not work. char c: int value; int i=0; .. somme init here.... do { i=0; if ( (UART1_Data_Ready())&& (i==0)) { c=UART1_Read() ; UART1_Write (c); // echo '6' en ascii value=( c-48)*10; // value=6*10=60 i++; } if ((UART1_Dat...
by paulfjujo
12 Apr 2024 08:12
Forum: mikroC PRO for PIC General
Topic: DHT22 with 18f4550
Replies: 2
Views: 95

Re: DHT22 with 18f4550

hello, You need to convert the values into a string. sprintf is allready used for that .. you try to put 2 bytes into a variable using an integer pointer ....so at same adress test this: define variables as (global) integer value no need to pass parameter to function void dht22_read int dht22_humi; ...
by paulfjujo
08 Apr 2024 19:34
Forum: mikroC PRO for PIC General
Topic: can I read two digit number using UART1_Read()?
Replies: 7
Views: 375

Re: can I read two digit number using UART1_Read()?

try this char c: int value; int i=0; .. somme init here.... do { i=0; if ( (UART1_Data_Ready())&& (i==0)) { c=UART1_Read() ; UART1_Write (c); // echo '6' en ascii value=( c-48)*10; // value=6*10=60 i++; } if ((UART1_Data_Ready()) && (i==1)) { c=UART1_Read() ; UART1_Write (c); // echo '5' ascii value...
by paulfjujo
07 Apr 2024 19:35
Forum: mikroC PRO for PIC General
Topic: can I read two digit number using UART1_Read()?
Replies: 7
Views: 375

Re: can I read two digit number using UART1_Read()?

hello,


what is your definition of a digit ?

Uart1_Read ( a_byte);

a value on 2 digits : ex: 65
MSB=6 LSB=5
BCD coded as
0110 00101

On other side : how are send theses 2 digits ?
in binary format 0100 0001
ascii format "65"
BCD format 0110 00101
by paulfjujo
13 Mar 2024 10:14
Forum: mikroC PRO for PIC General
Topic: How to store large integer value greater than 255 at particular location in eeprom(Solved))
Replies: 4
Views: 388

Re: How to store large integer value greater than 255 at particular location in eeprom(Solved))

hello, more simple solution The mikroC PRO for PIC compiler provides a set of useful built-in utility functions. The Lo, Hi, Higher, Highest routines are implemented as macros. If you want to use these functions you must include built_in.h header file (located in the include folder of the compiler) ...
by paulfjujo
12 Mar 2024 19:35
Forum: mikroC PRO for PIC General
Topic: temperature sensors giving wrong value
Replies: 3
Views: 228

Re: temperature sensors giving wrong value

hello, Impossible to give an answer without Schematic ... Does the PIC control Power delivered for the Heater ? Algorithm used PI , or PID ? The CTN formula is very long, use POW , log ... difference beetween TARGET and MEASURE needs an Integrale action .... (PI proportionnal and Integrale controler...
by paulfjujo
11 Mar 2024 15:28
Forum: mikroC PRO for PIC General
Topic: temperature sensors giving wrong value
Replies: 3
Views: 228

Re: temperature sensors giving wrong value

hello, Post your schematic ... it could help to understand what do you want to do ... if i get a good understanding, RESISTANCE is calculated via a Voltage ratio ? Did you get test the result of the function float temperature_from_resistance(float resistance) ie : trace the curve R=f (Temperature) i...
by paulfjujo
06 Dec 2023 11:06
Forum: mikroC PRO for PIC General
Topic: PIC18F46K22 INTERRUPT ON PORTB.0 5 volts
Replies: 6
Views: 407

Re: PIC18F46K22 INTERRUPT ON PORTB.0 5 volts

Hello Pumper, * what is the purpose of Inactive_Time variable ? * PulseTime = 35000000*4; // 140 000 000 how this value is fixed ? seems not related to FOSC MCU * what is the FOSC value ? * where, when , T1CON.TMR1ON is reset ? * at wich speed is running the main loop of programme ? 1seconde ? more ...
by paulfjujo
04 Dec 2023 10:34
Forum: mikroC PRO for PIC General
Topic: PIC18F46K22 INTERRUPT ON PORTB.0 5 volts
Replies: 6
Views: 407

Re: PIC18F46K22 INTERRUPT ON PORTB.0 5 volts

Hello Pumper, I don't know, how you treat the RB0 interrupt ..... A better way is to use software solution, a litle delay ,10 to 60mS inside the RB0 Int0 interrupt to debounce the reed contact... then read the satus of RB0 Pin input to confirm, yes , it is a true Low level 0 i get it ...to start the...
by paulfjujo
02 Dec 2023 20:38
Forum: mikroC PRO for PIC General
Topic: PIC18F46K22 INTERRUPT ON PORTB.0 5 volts
Replies: 6
Views: 407

Re: PIC18F46K22 INTERRUPT ON PORTB.0 5 volts

Hello,

For this low frequency, maybe you can use an analog input and comparator instead of Int0 RB0 interrupt
wich works with Edge detection
With a filter you dont'get sharp edge ..
by paulfjujo
29 Oct 2023 18:25
Forum: mikroC PRO for PIC General
Topic: 18F16Q40 PIC MCU not present in MicroC v7.6.0 compiler MCU list
Replies: 14
Views: 1914

Re: 18F16Q40 PIC MCU not present in MicroC v7.6.0 compiler MCU list

hello, I would be really interested to know if anyone gets the 27Q10 processor working with 7.60 as I've just ordered some of these for a project and realised they aren't supported. The las rescent ( or not too old) PIC i can use with MikroC 7.60 is PIC18F27K42 No way for using the 18FxxQ10 ! with M...
by paulfjujo
13 Aug 2023 19:17
Forum: mikroC PRO for PIC General
Topic: Combining 8 bit integers to 32 bit long integer
Replies: 2
Views: 466

Re: Combining 8 bit integers to 32 bit long integer

hello,

where do you store data in eeprom ; wich adresse ..?
we can suppose start adresse is 11 ?
remark: a pair adresse is always better ...;

Code: Select all

 unsigned char *p1;

 p1=&Distance;
 for(i = 0; i<3; i++)
 {
   *(p1+i)=EEPROM_Read(j+i);
 }
but not checked !!!
by paulfjujo
26 Jun 2023 19:18
Forum: mikroC PRO for PIC General
Topic: 12864 GLCD /RST
Replies: 1
Views: 363

Re: 12864 GLCD /RST

hello, rst is used for the 1rst display init ... this test in alphanumeic OK ... .. but not OK in graphic mode void glcd_init_graph(){ Delay_mS(40); rst=0; //reset LCD Delay_uS(10); rst=1; //LCD normal operation glcd_instruction(0x30); //set 8 bit operation and basic instruction set Delay_uS(144); g...
by paulfjujo
01 Jun 2023 12:59
Forum: mikroC PRO for PIC General
Topic: Cant communicate to SCD41 sensor on Click HVAC board
Replies: 2
Views: 523

Re: Cant communicate to SCD41 sensor on Click HVAC board

Hello, did you try to read serial number, so check if I2C link and sensor are ok... 3.9.2 get_serial_number Description: Reading out the serial number can be used to identify the chip and to verify the presence of the sensor. The get serial number command returns 3 words, and every word is followed ...

Go to advanced search