Search found 22 matches

by ira
10 Feb 2019 22:57
Forum: mikroC PRO for PIC Beta Testing
Topic: What the heck is this beta doing?
Replies: 4
Views: 2481

Re: What the heck is this beta doing?

Thanks for the explanation. The intricacies of C compiler rules are not something I'm familiar with so thanks for pointing out my misunderstanding. I think I'm currently at 4K used of 32K Flash and 200 bytes used of 2K of RAM. I don't need the processor, I just need the CAN engine so I get way more ...
by ira
09 Feb 2019 04:09
Forum: mikroC PRO for PIC Beta Testing
Topic: What the heck is this beta doing?
Replies: 4
Views: 2481

Re: What the heck is this beta doing?

On purpose, when I tried other levels, the code doesn't work and I have no memory or speed issues. But even with that, it's still a bit wordy, isn't it?

Ira
by ira
08 Feb 2019 06:36
Forum: mikroC PRO for PIC Beta Testing
Topic: What the heck is this beta doing?
Replies: 4
Views: 2481

What the heck is this beta doing?

This code within a larger piece of code generates assembly code that seems to make no sense. Note that the beginning and ending MOVLB 0 are not part of this command but exist right before and right after this code. unsigned char k, v; unsigned long c; c = (uint16_t)(k * v) ; Generates this in my cod...
by ira
06 Nov 2018 05:33
Forum: mikroC PRO for PIC General
Topic: K42 - Known problems & Workarounds?
Replies: 8
Views: 2775

Re: K42 - Known problems & Workarounds?

All I know is in order to get my code to run, I had to change it so it only used 16bit math. If 32 was included, I randomly got wrong answers and hangs during 32 bit math operations. Luckily I did not need the 32 bit math, the compiler just liked including it.

Ira
by ira
06 Nov 2018 01:40
Forum: mikroC PRO for PIC General
Topic: K42 - Known problems & Workarounds?
Replies: 8
Views: 2775

Re: K42 - Known problems & Workarounds?

The 32 bit math library is worse than useless on the K83, possibly also on the K42.

Ira
by ira
24 Jul 2018 23:06
Forum: mikroC PRO for PIC General
Topic: Bugs in compiler using PIC18F25K83
Replies: 17
Views: 6188

Re: Bugs in compiler using PIC18F25K83

This approach to software development is not normal, especially with professional tools. I think you misunderstand the MikroElektronica audience. Personally I refer to it as the worlds worst compiler, but with it I was able to solve one problem and deliver one product. I tend to stay far away from ...
by ira
21 Jul 2018 08:21
Forum: mikroC PRO for PIC General
Topic: PicChip PIC18F25K80 A/D converter issue
Replies: 14
Views: 4092

Re: PicChip PIC18F25K80 A/D converter issue

Why not just write the code by hand, reading the analog voltage is only about this hard: ADCON0 = 0b00000011; while (ADCON0 & 0b00000010){asm CLRWDT;} ADCON0 = 0b00000011; while (ADCON0 & 0b00000010){asm CLRWDT ;} result = ADRESH; That code I run on a 25K80. I don't use the 2V reference because it w...
by ira
21 Jul 2018 01:11
Forum: mikroC PRO for PIC General
Topic: Bugs in compiler using PIC18F25K83
Replies: 17
Views: 6188

Re: Bugs in compiler using PIC18F25K83

Thanks. I was able to get the compiler to stop using 32 bit multiply and so it works again which is all I really care about, but they released it as working and ought to know how badly it's broken. Maybe it will spare someone else the heartache.

Ira
by ira
20 Jul 2018 17:40
Forum: mikroC PRO for PIC General
Topic: Bugs in compiler using PIC18F25K83
Replies: 17
Views: 6188

Re: Bugs in compiler using PIC18F25K83

Sadly I can't as it's currently in litigation, but I wrote this for you and it crashes quite quickly. ;Decrypt.c,71 :: r12 = r9_base[(uint8_t)c]; 0x0D7A 0xF000F3580060 MOVFFL key2password_c_L0, 0 0x0D80 0x0E00 MOVLW 0 0x0D82 0x6E01 MOVWF R1 0x0D84 0x6E02 MOVWF R2 0x0D86 0x6E03 MOVWF R3 0x0D88 0x0E04...
by ira
20 Jul 2018 17:13
Forum: mikroC PRO for PIC General
Topic: Add big data chunk to flash memory during programming?
Replies: 3
Views: 1388

Re: Add big data chunk to flash memory during programming?

I think in C you will need to write it at a number of consecutive arrays of const chars, preferably specifying then as in flash if that's possible. Then you'll need to write some sort of access routine to get to the data you need. Conceptually it could be one long array but I've no idea if the compi...
by ira
20 Jul 2018 17:06
Forum: mikroC PRO for PIC General
Topic: Issue outputting DHT22 sensor result via UART
Replies: 2
Views: 1497

Re: Issue outputting DHT22 sensor result via UART

Unless I'm missing something, left shifting a char by 8 should always return zero. To start I think you should try making RH_Integral an int so you don't shift all the data off the end. Also, efficiency wise, you might consider changing this code: for(i=0; i<8; i++){ if (RH_Integral & 1<<i){ UART1_W...
by ira
20 Jul 2018 03:37
Forum: mikroC PRO for PIC General
Topic: Add big data chunk to flash memory during programming?
Replies: 3
Views: 1388

Re: Add big data chunk to flash memory during programming?

When I needed to do this, I wrote a program, in those days in Cliipper, today I'd use VB, that generates a header file with the data as a long constant string or array and then just #include that file where needed. table.h looked like this: dt 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 dt ...
by ira
19 Jul 2018 19:11
Forum: mikroC PRO for PIC General
Topic: Bugs in compiler using PIC18F25K83
Replies: 17
Views: 6188

Bugs in compiler using PIC18F25K83

Is there any reason why when the compiler makes calls to _Mul_32X32_U I randomly get one of the following results. 1: Wrong answer 2: program never returns 3: program resets I know it's _Mul_32X32_U because when I spent a lot of time getting rid of it my code suddenly started working. It's a bunch s...
by ira
09 Jul 2018 01:16
Forum: mikroC PRO for PIC Beta Testing
Topic: compiler issue in 7.2.0
Replies: 5
Views: 3364

Re: compiler issue in 7.2.0

And why is this code efficient: ;CutoutMain.c,68 :: if (INTCON.TMR0IF == 1){ 0x003B 0x1D0B BTFSS INTCON, 2 0x003C 0x283F GOTO L_main9 And this code which should use BTFSC takes twice as many instruction cycles because it uses BTFSS? ;CutoutMain.c,77 :: if (state == 0){ 0x0044 0x0823 MOVF main_state_...
by ira
09 Jul 2018 01:09
Forum: mikroC PRO for PIC Beta Testing
Topic: compiler issue in 7.2.0
Replies: 5
Views: 3364

Re: compiler issue in 7.2.0

And another one? What is the difference between these 2 pieces of code, should they not generate the same code? ;CutoutMain.c,59 :: if (keypressed == (20+2)){//(KEY_PRESS_TIME + 2)){ 0x002B 0x3000 MOVLW 0 0x002C 0x3A00 XORLW 0 0x002D 0x1D03 BTFSS STATUS, 2 0x002E 0x2831 GOTO L__main18 0x002F 0x3016 ...

Go to advanced search