Search Results - MEL PICBASIC Forum

# Search:

Type: Posts; User: richard; Keyword(s):

Page 1 of 4 1

1. ## Thread: 16Bit 125KHz PWM with PIC12F1572

by richard
Replies
1
Views
32

### Re: 16Bit 125KHz PWM with PIC12F1572

125KHz is [COLOR=#333333]only available with a pbpl compile

from the manual hpwm section

every chip you have posted about on this subject is quite capable of that output.
2. ## Thread: PWPS Servo Problem

by richard
Replies
1
Views
28

### Re: PWPS Servo Problem

why would the uart need a TMR1 interrupt ?

code ?
3. ## Thread: 125KHz HW PWM Output

by richard
Replies
9
Views
352

### Re: 125KHz HW PWM Output

your understanding is flawed and math is incorrect

Duty is Steps x 0.625% // steps = CCPR1L x4 + CCP1CON<5:4>

so:
80x0.625% = 50% <=> steps = 20x4 + 0
56x0.625% = 35% ...
4. ## Thread: 125KHz HW PWM Output

by richard
Replies
9
Views
352

### Re: 125KHz HW PWM Output

totally missing the point

CCPR1L = \$14 not 14 ; its hex 14 or dec 20
5. ## Thread: 125KHz HW PWM Output

by richard
Replies
9
Views
352

### Re: 125KHz HW PWM Output

maybe more like duty cycle of 2.8us/8us * 100 = 35%

or correctly
' To get a 50% duty cycle output,
CCPR1L to \$14 and CCP1CON<5:4> to <0:0>.
6. ## Thread: Sleep does not really sleep...

by richard
Replies
8
Views
473

### Re: Sleep does not really sleep...

from the data sheet, my best guess . i see no attempt to read portb before sleep
7. ## Thread: PIC18FxxQ43 Version of DT_INTS

by richard
Replies
25
Views
1,963

### Re: PIC18FxxQ43 Version of DT_INTS

You need to travel back in time ten years , last known semi workable setup was with mplabx 2.35
8. ## Thread: Data processing in array

by richard
Replies
12
Views
707

### Re: Data processing in array

i would not expect to ever receive a malformed bit from a keeloq serial stream , the data may be useless however.
single point sampling should be ok imho
9. ## Thread: How to detect variable going below zero, without using PBPL ?

by richard
Replies
18
Views
1,175

### Re: How to detect variable going below zero, without using PBPL ?

in simple terms adding the two's compliment of a var to a number is equivalent to subtracting the var from a number
providing they are all the same integer var type
10. ## Thread: Data processing in array

by richard
Replies
12
Views
707

### Re: Data processing in array

In a noisy environment you can over sample a bit to be sure of data validity, i expect the serial data from a keeloq
chip to be quite clean so a single sample point would suffice

sample...
11. ## Thread: Data processing in array

by richard
Replies
12
Views
707

### Re: Data processing in array

a couple of ways

pulsetrain:
index=67
while index
while !portb.0 :wend ;wait for hi
index=index-1
pauseus 600 ;bit period=3*te ie 3*400=1200uS
code.0[index]= ~...
12. ## Thread: Data processing in array

by richard
Replies
12
Views
707

### Re: Data processing in array

result of sim
9225
13. ## Thread: Data processing in array

by richard
Replies
12
Views
707

### Re: Data processing in array

maybe but it has positive indication of failure , it ceases testing on failure and it actually detects failures.
i would not be quibbling over a few words of code space when the entire process of...
14. ## Thread: Data processing in array

by richard
Replies
12
Views
707

### Re: Data processing in array

i would do it this way

sample_data var byte[32]
fail var bit
sample var byte
a_one var byte
a_zero var byte
15. ## Thread: Parsing commands and parameters

by richard
Replies
4
Views
318

### Re: Parsing commands and parameters

so a command is *99 or *9 or *09 [where 9 == a numeric digit]
and a parameter is 9 up to 999999

how do you signal that the command has been input and the parameter begins

i would be...

by richard
Replies
6
Views
494

where did you get that idea, it is very possible with the correct syntax

suggest a read of the manual re

Applying Offsets to Bits within a Variable or Register
17. ## Thread: Parsing commands and parameters

by richard
Replies
4
Views
318

### Re: Parsing commands and parameters

what is the biggest command sequence that will be input ?
how does the pic know when the input seq is complete ?

18. ## Thread: BH1750FVI sample code available?

by richard
Replies
14
Views
4,522

### Re: BH1750FVI sample code available?

its best to be correct for future reference , not all i2c devices are so forgiving
19. ## Thread: BH1750FVI sample code available?

by richard
Replies
14
Views
4,522

### Re: BH1750FVI sample code available?

as maybe but you are still incorrect , if you use a logic analyzer you will see the transaction ends abnormally

wrong way
correct way
i2cwrite ldta, lclk,...
20. ## Thread: BH1750FVI sample code available?

by richard
Replies
14
Views
4,522

### Re: BH1750FVI sample code available?

not in my view
21. ## Thread: My "Library" for ST7920 Graphical displays, works fine, but...

by richard
Replies
30
Views
2,506

### Re: My "Library" for ST7920 Graphical displays, works fine, but...

9x2x8 lcd "command delays" per text line is probably the worst delay
your snippet lacks that exact detail

the st7920 chip has a spi i/f that's a little faster and uses less pins too

there...
22. ## Thread: How to detect variable going below zero, without using PBPL ?

by richard
Replies
18
Views
1,175

### Re: How to detect variable going below zero, without using PBPL ?

its called two's compliment , no magic involved

https://en.wikipedia.org/wiki/Two%27s_complement
23. ## Thread: BH1750FVI sample code available?

by richard
Replies
14
Views
4,522

### Re: BH1750FVI sample code available?

each and every i2c command has incorrect syntax
24. ## Thread: How to detect variable going below zero, without using PBPL ?

by richard
Replies
18
Views
1,175

### Re: How to detect variable going below zero, without using PBPL ?

only if you interpret it incorrectly and ignore the sign bit

25. ## Thread: How to detect variable going below zero, without using PBPL ?

by richard
Replies
18
Views
1,175

### Re: How to detect variable going below zero, without using PBPL ?

what does get bad mean ?