Search found 124 matches

by Const50
30 Jul 2022 07:40
Forum: mikroBasic PRO for PIC32 General
Topic: Transformation mBasic code to Assembler one
Replies: 4
Views: 1634

Re: Transformation mBasic code to Assembler one

I've understood: the high speed code is suitable for 8 bit code. For 32 bit it is much slower and to increase the code execution I must increase tact frequency only. Nothing more.
by Const50
25 Jul 2022 10:01
Forum: mikroBasic PRO for PIC32 General
Topic: Transformation mBasic code to Assembler one
Replies: 4
Views: 1634

Re: Transformation mBasic code to Assembler one

You think it will be enough? This is assemble code for the mBasic compilation, not direct assembling code which is much shorter...
by Const50
24 Jul 2022 15:06
Forum: mikroBasic PRO for PIC32 General
Topic: Transformation mBasic code to Assembler one
Replies: 4
Views: 1634

Transformation mBasic code to Assembler one

Who can help to transform the procedure loops into Assembler code for PIC32MZ2048EFH064 mBasic code: Sub procedure A dim i, k as longword j as word M1 as byte [40000] data CKd as sbit at LATB8_bit HD as byte at LATB CKd=0 For j=0 to 100 k=j*360 For i=0 to 100 HD=M1[i+k] CKd=1 CKd=0 next i next j end...
by Const50
21 May 2022 07:53
Forum: mikroBasic PRO for PIC General
Topic: Sirena sound with Sound_Play doesn't work
Replies: 3
Views: 1096

Re: Sirena sound with Sound_Play doesn't work

I mean basic sound sample from Sound library.
by Const50
19 May 2022 11:02
Forum: mikroBasic PRO for PIC General
Topic: Sirena sound with Sound_Play doesn't work
Replies: 3
Views: 1096

Re: Sirena sound with Sound_Play doesn't work

Yes, I've did it, everything O'K.
by Const50
18 May 2022 14:23
Forum: mikroBasic PRO for PIC General
Topic: Sirena sound with Sound_Play doesn't work
Replies: 3
Views: 1096

Sirena sound with Sound_Play doesn't work

I try to make an emergensy sirena sound with the procedure: sub procedure Sirena() n = 500 While true While n<=2000 Sound_Play(n, 1) n=n+1 wend While n>=500 Sound_play(n, 1) n=n-1 wend wend end sub But it doesn't work, no ssound. What's wrong?
by Const50
02 Jun 2021 05:14
Forum: mikroBasic PRO for PIC General
Topic: Sound_Play doesn't work with interrupts
Replies: 2
Views: 1059

Re: Sound_Play doesn't work with interrupts

No it is too complicated.
We'll go by another way.((C) V. Lenin)
by Const50
29 May 2021 08:08
Forum: mikroBasic PRO for PIC General
Topic: Sound_Play doesn't work with interrupts
Replies: 2
Views: 1059

Sound_Play doesn't work with interrupts

When I try to use Sound_Play in main program and in interrupt handler routine, I get message: Reentrancy is not allowed: function 'Sound_Play' called from two threads __Lib_Sound.mpas ... It is handler in main program: sub procedure Interrupt If TestBit(INTCON, TMR0IF) = 1 then ' Inc(n) INTCON.2=0 '...
by Const50
05 Jun 2019 02:01
Forum: mikroBasic PRO for PIC General
Topic: PWM bursts not continous
Replies: 8
Views: 2347

Re: PWM bursts not continous

Pls compare with yours. This code works continously, without "windows" between sine takts (gap 18 - 35 mS), but gives DC not more than 50%. No 100. Tsin = 150 mS (appr. 6 Hz).
by Const50
04 Jun 2019 15:54
Forum: mikroBasic PRO for PIC General
Topic: PWM bursts not continous
Replies: 8
Views: 2347

Re: PWM bursts not continous

What is Fsys?
by Const50
01 Jun 2019 02:45
Forum: mikroBasic PRO for PIC General
Topic: PWM bursts not continous
Replies: 8
Views: 2347

Re: PWM bursts not continous

Fsys=655.36 KHz, external clock.
by Const50
01 Jun 2019 02:32
Forum: mikroBasic PRO for PIC General
Topic: PWM bursts not continous
Replies: 8
Views: 2347

Re: PWM bursts not continous

Hi Stefan, Since I write in mBasic, I can't inderstand your code. What means "current_duty ++"? Since there is in the loop a delay (5 mS) you have not unbrocken sine, but with windows (5 mS)? What loop does "while (1)"? Belowe my code on mBasic: program A const Table_Sin as byte[256] = (128,131,134,...
by Const50
30 May 2019 13:25
Forum: mikroBasic PRO for PIC General
Topic: PWM bursts not continous
Replies: 8
Views: 2347

PWM bursts not continous

PIC16LF1503, PWM library, Fpwm 10 KHz. When I start PWM in a circle While - wend

Code: Select all

 While true
       For i=0 to 255                
         PWM3_Set_Duty(Table_Sin[i])
       next i
 wend
I see not continous sine but 1 tact sines with delay among sine bursts approx 100 ms.
What is wrong?
by Const50
30 Apr 2019 13:50
Forum: mikroBasic PRO for PIC General
Topic: PWM for mid-range PIC12LF1501
Replies: 1
Views: 735

PWM for mid-range PIC12LF1501

In PWM lib in Procedure PWMx_Init there is a note: for enhanced mid-range 150x MCUs (PIC12LF1501) in procedure must be parameters freq_hz and timer prescaler: PWM1_Init(100000, 64). Really when I compile it I get error message: Syntax error: Expected ")" but "," found, i.e. does it means PIC12LF1501...
by Const50
21 Aug 2018 13:16
Forum: mikroBasic PRO for PIC32 General
Topic: Draw a line with Brethenham algorithm
Replies: 0
Views: 6229

Draw a line with Brethenham algorithm

Did somebody implement the Brethenhame algorithm for line drawing? I try to use it but with partial success: it good draws the line in one direction (first quadrant) and draws the line in another directions either in wrong position or does not draw at all. Below the standard procedure applied to PIC...

Go to advanced search