Search found 53 matches

by gedo
11 Nov 2019 12:04
Forum: mikroC PRO for PIC General
Topic: (Not Compiler Fault)compiler bug on LATA.B6 never set to1
Replies: 2
Views: 930

(Not Compiler Fault)compiler bug on LATA.B6 never set to1

before to get this fault I was change some function for Uart communications. it works normally when it returns to old code. this while never ending because 6 th bit not going to high MikroC while(PORTA.B6==0){ TRISA=0; delay_ms(1); LATA.B6=1; delay_ms(1); } ASM: L_main187: 0x182E 0xBC80 BTFSC PORTA,...
by gedo
08 May 2018 23:17
Forum: mikroC PRO for PIC General
Topic: 10K data to SD/MMC
Replies: 1
Views: 847

10K data to SD/MMC

Hi guys. I need a way or same idea how to write 10K in second to SD card.
my last SD card U3 and is not enough. Or anybody have a more fast libs ?

5000 Sector with 512 byte array write times
U30 Sd Card--14.201ms and is equal nearly 1.5K

PIC18F26K20 64Mhz

SPI1_Init_Advanced(_SPI_MASTER_OSC_DIV4,
by gedo
01 Feb 2018 00:29
Forum: mikroC PRO for PIC General
Topic: 18F26K20 PortB Change INT [SOLVED]
Replies: 2
Views: 1197

Re: 18F26K20 PortB Change INT

I found problem or different logic. Remove the resistors and chenge the pulup order of portB WPUB=0xF0 to WPUB=0x0F; http://95.70.216.173:1071/mernis/photo_2018-01-31_22-35-43.jpg void interrupt(){ // Interrupt rutine if(RBIF_bit == 1 ) { // Checks for Receive Interrupt Flag bit RBIF_bit = 0; // Cle...
by gedo
31 Jan 2018 17:05
Forum: mikroC PRO for PIC General
Topic: 18F26K20 PortB Change INT [SOLVED]
Replies: 2
Views: 1197

Re: 18F26K20 PortB Change INT

Note 1: A mismatch condition will continue to set the RBIF bit. Reading PORTB will end the
mismatch condition and allow the bit to be cleared.
2: RB port change interrupts also require the individual pin IOCB enables.
by gedo
31 Jan 2018 14:08
Forum: mikroC PRO for PIC General
Topic: 18F26K20 PortB Change INT [SOLVED]
Replies: 2
Views: 1197

18F26K20 PortB Change INT [SOLVED]

HI. in these code maybe not have a problem but I do not know. (maybe Proteus simulation ) Problem is when pres any button PortB Change interrupt is activated and Led is going to flash and its mean that interrupt is called again continuously. I want it to stop for each interrupt. http://95.70.216.173...
by gedo
12 Jan 2018 03:39
Forum: mikroC PRO for PIC General
Topic: UART & two speed OSC
Replies: 2
Views: 1255

Re: UART & two speed OSC

OSCCON=0x77; // 16Mhz UART1_Init(115200); // initialize UART1 module delay_ms(1); SPBRG=70; delay_ms(1); IntToStr(SPBRG, txt); UART_Write_Text("<<"); UART_Write_Text(txt); UART_Write_Text(">>"); OSCCON=0b01000010; //Return to 0.5Mhz SPBRG=8; its work
by gedo
12 Jan 2018 03:04
Forum: mikroC PRO for PIC General
Topic: UART & two speed OSC
Replies: 2
Views: 1255

UART & two speed OSC

HI Everybody . I have no idea how to do that. maybe need same declaration for compiler or other way. problem is that after initialize UART I need to change CPU speed. it changes with it . :roll: :| :!: :?: Project setings is for 16Mhz OSCCON=0b01000010; //0x22 500Khz Speed UART1_Init(56000); // init...
by gedo
07 Jan 2018 01:19
Forum: mikroC PRO for PIC General
Topic: ADC INTERRUPT lOGIC
Replies: 1
Views: 1001

Re: ADC INTERRUPT lOGIC

in loop need be used

Code: Select all

ADON=1;
because after 1 minute I see than is changed by self and ADC module is power off . :)
by gedo
06 Jan 2018 03:01
Forum: mikroC PRO for PIC General
Topic: ADC INTERRUPT lOGIC
Replies: 1
Views: 1001

ADC INTERRUPT lOGIC

HI. I dint know what is logic to use ADC interrupt on sleep. Or how to determinate interrupt validity over specifics values on ADC. because when I turn MCU on sleep mode immediately get interrupt on ADC and CPU is wake up . I have Filtered inputs on project and normally read ADC results 511 between ...
by gedo
06 Jan 2018 02:40
Forum: mikroC PRO for PIC General
Topic: Timer1 and ADC interrupt together problem
Replies: 4
Views: 1687

Re: Timer1 and ADC interrupt together problem

Simple Code for ADC on Sleep CPU:PIC18F26K20 void main() { int val1; char txt[7]; unsigned char ADHIGH, ADLOW; OSCCON=0b00100010; // 0.5 Mhz ADCON2=0b10101111; ADCON1=0b00000000; TRISA0_bit=1; ANS0_bit=1; ADCON0=0b00000001; /////// ADC AN02 READ ////////////// CHS3_bit=0;CHS2_bit=0;CHS1_bit=1;CHS0_b...
by gedo
03 Jan 2018 01:38
Forum: mikroC PRO for PIC General
Topic: Timer1 and ADC interrupt together problem
Replies: 4
Views: 1687

Re: Timer1 and ADC interrupt together problem

For adc on sleep need FRC cpu speeds be selected OSCCON=0x17; delay_us(75); asm{sleep}; Now is work 19.2.7 ADC OPERATION DURING SLEEP The ADC module can operate during Sleep. This requires the ADC clock source to be set to the FRC option. When the FRC clock source is selected, the ADC waits one addi...
by gedo
03 Jan 2018 00:51
Forum: mikroC PRO for PIC General
Topic: Timer1 and ADC interrupt together problem
Replies: 4
Views: 1687

Re: Timer1 and ADC interrupt together problem

is not enough?


and timmer is counting when GIE_bit=1;
only ADIF bit not active

Code: Select all

GIE_bit=1; // re-enable interrupts  ? ???????????????????????????????????

  TMR1IF_bit=0; ====> TMR1 int Clear
  ADIF_bit=0;    ====> ADC int Clear
by gedo
02 Jan 2018 18:05
Forum: mikroC PRO for PIC General
Topic: Timer1 and ADC interrupt together problem
Replies: 4
Views: 1687

Timer1 and ADC interrupt together problem

PIC18F26K20 Can anybody help me please. check my code where is mistake or my CPU is crazy .. Timer is working but ADC interrupt not accurate //sbit ADGD at GO_DONE_bit; int voltage_val,ADC_cnt,gSecs; void init() { CM2CON1=0x00;// 144 10010000 CM2CON0=0x00;// 0 00000000 CM1CON0=0x00;// 221 11011101 A...
by gedo
01 Jan 2018 14:11
Forum: mikroC PRO for PIC General
Topic: ADC LIB is Work but code not
Replies: 1
Views: 985

Re: ADC LIB is Work but code not

Sorry guys I found my mistake :)

bit 5-2 CHS<3:0>: Analog Channel Select bits
0000 = AN0
0001 = AN1
0010 = AN2
0011 = AN3
0100 = AN4

old
ADCON0=0b00000001;// AN1, ADC on

right conf
ADCON0=0b00000100;// AN1, ADC on

Go to advanced search