Search found 1550 matches

by paulfjujo
07 May 2024 18:05
Forum: mikroC PRO for PIC General
Topic: HELP WITH FUNCTIONS
Replies: 1
Views: 155

Re: HELP WITH FUNCTIONS

Hello, Are MILES and MILESt variables declared as Global ? long MILES; long MILESt; why did you put My_DatA as a comment ? Be carrefull ! My_Dat A is not the same variable as My_Data ! unsigned short My_EEPROM_Read(unsigned int address) { //unsigned short My_DatA; <---- ? NVMCON1=0; //reset all to 0...
by paulfjujo
03 May 2024 18:21
Forum: mikroC PRO for PIC General
Topic: UART1_Read_Text() is not working when I used escape sequences like \r\n
Replies: 6
Views: 187

Re: UART1_Read_Text() is not working when I used escape sequences like \r\n

hello, UART can be blocked if OVERFLOW occurs !!! and error not treated ! when adding a delay , if data are always send by your terminal, during this laps of time .. MCU itslef can't store incomming data anymore -> OVERFLOW i don't know how MikroE manage the function UART1_Read_Text(uart_input,";", ...
by paulfjujo
01 May 2024 17:22
Forum: mikroC PRO for PIC General
Topic: UART1_Read_Text() is not working when I used escape sequences like \r\n
Replies: 6
Views: 187

Re: UART1_Read_Text() is not working when I used escape sequences like \r\n

next thing you are talking about interrupt, could you explain more about this thing like, how to use interrupt? tested on PIC12F1840 #define MAXLEN1 64 char Buffer1[MAXLEN1]; unsigned short error; volatile unsigned int CptErr; volatile int DataReady1 =0; // drapeau Data recu volatile int NB; volati...
by paulfjujo
30 Apr 2024 09:34
Forum: mikroC PRO for PIC General
Topic: PIC18F47K42 EEPROM
Replies: 4
Views: 124

Re: PIC18F47K42 EEPROM

hello, Since One year, i not use anymore MikroC ..because not updated for new MCU Must use Necto Studio wich replace MikroC , but it is to much complicated and Heavy.... and need additional cost to pay !! even you allready have a MickroC Pro Licence. i use MPLABX XC8 , mode difficult to learn, but a...
by paulfjujo
30 Apr 2024 08:52
Forum: mikroC PRO for PIC General
Topic: UART1_Read_Text() is not working when I used escape sequences like \r\n
Replies: 6
Views: 187

Re: UART1_Read_Text() is not working when I used escape sequences like \r\n

Hello, you can try this : Delay located outside of RX loop while(1) { if(UART1_Data_Ready() == 1){ UART1_Read_Text(st, ";", 255); UART1_Write_Text(st); strcpy(str,st); } else{ UART1_Write_Text(str); } UART1_Write_Text("\r\n"); Delay_ms(1000); } A better way is to use interrupt to manage RX UART ...
by paulfjujo
29 Apr 2024 10:28
Forum: mikroC PRO for PIC General
Topic: PIC18F47K42 EEPROM
Replies: 4
Views: 124

Re: PIC18F47K42 EEPROM

Hello, :o There is a bug in MikroC compiler !!!! it is a old problem, not solved by MikroE .. usage de l'eeprom PIC Rappel bug MikroC sur adresse départ Eeeprom => à modifier! dans Eeeprom file *.ihex OLD adresse :02000004[b]0121[/b]D8 2101H because reverse order : LSB then MSB [b]NEW adresse[/b] :0...
by paulfjujo
26 Apr 2024 08:03
Forum: mikroC PRO for PIC General
Topic: PIC18F47K42 USING DS1307 CLOCK I2C
Replies: 2
Views: 185

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: 1313

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: 179

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: 1313

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: 1313

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: 574

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: 403

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: 403

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: 570

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 ...

Go to advanced search