Search Results - MEL PICBASIC Forum


Search:

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

Page 1 of 4 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    9
    Views
    315

    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% ...
  2. Replies
    9
    Views
    315

    Re: 125KHz HW PWM Output

    totally missing the point

    CCPR1L = $14 not 14 ; its hex 14 or dec 20
  3. Replies
    9
    Views
    315

    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>.
  4. Replies
    8
    Views
    422

    Re: Sleep does not really sleep...

    from the data sheet, my best guess . i see no attempt to read portb before sleep
  5. Replies
    25
    Views
    1,913

    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
  6. Replies
    12
    Views
    673

    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
  7. 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
  8. Replies
    12
    Views
    673

    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...
  9. Replies
    12
    Views
    673

    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]= ~...
  10. Replies
    12
    Views
    673

    Re: Data processing in array

    result of sim
    9225
  11. Replies
    12
    Views
    673

    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...
  12. Replies
    12
    Views
    673

    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
  13. Replies
    4
    Views
    306

    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...
  14. Re: Adding and reading byte variable from the bit array?

    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
  15. Replies
    4
    Views
    306

    Re: Parsing commands and parameters

    ask yourself

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

    when you know those answers then the answer will be obvious
  16. Replies
    14
    Views
    4,508

    Re: BH1750FVI sample code available?

    its best to be correct for future reference , not all i2c devices are so forgiving
  17. Replies
    14
    Views
    4,508

    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
    i2cwrite ldta, lclk, adr, cnt
    correct way
    i2cwrite ldta, lclk,...
  18. Replies
    14
    Views
    4,508

    Re: BH1750FVI sample code available?

    not in my view
    addr var byte
    addr= $46
    i2cwrite sda,sck,addr,[opecode]
    i2cread sda,sck,addr,[dat.highbyte,dat.lowbyte]
  19. 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...
  20. 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
  21. Replies
    14
    Views
    4,508

    Re: BH1750FVI sample code available?

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

    only if you interpret it incorrectly and ignore the sign bit



    show your code
  23. Re: How to detect variable going below zero, without using PBPL ?

    what does get bad mean ?

    show your code
  24. Re: How to detect variable going below zero, without using PBPL ?

    what have you tried ?
    in what way does it not provide a correct result?

    signed divides, multiplies and shifts need proper handling of the sign bit
    otherwise as long as the vars match in type...
  25. Re: Adapting a PICAXE program to PBP, to program a PIC (compiler Errors)

    a Pic12F629 has no adc module ADCIN Potar,PotADC is never going to fly use a Pic12F675

    also if you post code please put it in code tags 9220
Results 1 to 25 of 100
Page 1 of 4 1 2 3 4