Search Results - MEL PICBASIC Forum


Search:

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

Page 1 of 4 1 2 3 4

Search: Search took 0.03 seconds.

  1. Re: HSEROUT using STR modifier - length parameter as variable not working

    Of course, since the macro only uses the low byte of R4 to index the array. That would also make it fail when using a constant >255.

    In any case, the "example" posted in the first place had a BYTE...
  2. Re: HSEROUT using STR modifier - length parameter as variable not working

    Which device are you using?

    I compiled two different version and looked at the .lst and with my limited understanding of assembly I'd say it "should work"

    First, HSEROUT [STR Buffer\16]


    ...
  3. Re: HSEROUT using STR modifier - length parameter as variable not working

    I don't know and I can't test/try if your code right now but a simple workaround would be

    For i = 0 to BalCount ' (Or possibly BalCount-1)
    HSEROUT [BalBuffer]
    NEXT
    HSEROUT [26,13]
  4. Re: PIC18F1220 - Variables initialisation placement makes a change

    Further, variables aren't automatically initialized (ie set to a specific value).

    Where in your code you put the declaration of the variable can change the ORDER of the variables in RAM so if,...
  5. Re: Unable to fit variable XXX in requested bank 0

    I don't know but the way I understand and interpret it is that between user variables that HAVE specific bank requests and those that don't the first ones ARE handled first - but still AFTER the PBP...
  6. Re: Unable to fit variable XXX in requested bank 0

    Remember that PBP itself uses a bunch of variables and it most likely needs to use BANK0 for them for the same reason that you want to use BANK0. The number of variables PBP uses depends on what...
  7. Replies
    32
    Views
    1,736

    Re: Rotary encoder with DT interrupts

    I was a little quick with that PCON thing, on startup set PCON = %00011111 then let the program run



    serout2 PORTC.6, 16468, ["Power-on:", BIN8 STATUS, " - ", BIN8 PCON, 10,13]
    PCON =...
  8. Replies
    32
    Views
    1,736

    Re: Rotary encoder with DT interrupts

    Since the I'm alive output is outside of and before Main it looks to me as if the PIC is resetting and starting over. Try something like:

    serout2 PORTC.6, 16468, [BIN8 STATUS, " - ", BIN8 PCON,...
  9. Replies
    1
    Views
    219

    Re: Datasheet RANT

    Hmm, section 1.4 in the datasheet I happen to look at seems to show, in quite some details, how data is exchanged and they let you know that more details can be found in the SH-2 Reference Manual.
    ...
  10. Replies
    4
    Views
    424

    Re: HEF EE OK with WRITE ?

    The datasheet for the 16F19176 seems to indicate that the device has actual EEPROM on board and does not mention HEF (High Endurance Flash) so I would expect DATA/READ/WRITE to work with that device....
  11. Replies
    4
    Views
    424

    Re: HEF EE OK with WRITE ?

    Disclaimer: Have never actually used HEF so this is not based on experience but rather on how I believe/think it works.

    Since HEF is part of FLASH I'd say the command(s) to use is...
  12. Replies
    10
    Views
    752

    Re: Logical AND/OR/ Sequencing question

    The gold and silver editions allows you to install and activate PBP on up to 3 machines, do you have that many and still need that extra laptop?
  13. Replies
    2
    Views
    325

    Re: 18F1220 - DEBUGIN not working

    The pin you're trying to use is configured for analog input.
  14. Replies
    10
    Views
    752

    Re: Logical AND/OR/ Sequencing question

    Have you TRIED it? Sometimes simply trying a few things out on your own gives you the answer much faster than asking here.


    IF (A=1 AND B<6) OR (A=2) THEN
    LED = 1
    ENDIF

    Whenever A = 2 LED...
  15. Replies
    10
    Views
    752

    Re: Logical AND/OR/ Sequencing question

    AND, OR, XOR, ANDNOT, ORNOT, XORNOT all have the same precedence and so are evaluated from left to right. But, as the manual says:

    IF (A=1 AND B<6) OR (A=2) THEN makes it much clearer.
  16. Replies
    25
    Views
    1,858

    Re: DEFINE RESET_ORG and DEC modifier issue

    Yeah, until you here from Charles I'd be very careful with pushing the library routines beyond the 64k barrier.

    I did compile the code and I did look at the .lst but I didn't see/understood the...
  17. Re: Change variable increment/decrement into mid-loop?

    Regarding negative numbers, as long as both variables are of the same size what you did will work:

    Cnt VAR BYTE
    Add VAR BYTE

    Cnt = 100
    Add = -1

    Cnt = Cnt + Add ' Cnt now = 99
  18. Re: getting my head around PICS with SR-Latch registers - and how to properly use the

    In a perfect world (or a simulator) writing to PORT will have the same effect as writing to LAT. In the real world that's not always the case - depending on various circuimstances.
    On any PIC that...
  19. Re: Change variable increment/decrement into mid-loop?

    Something like this perhaps?


    Cnt VAR BYTE
    Dir VAR BIT

    UP CON 1
    DOWN CON 0

    SomeLoop:
  20. Re: HSERIN using EUSART RX interrupt - how does it really work?

    First, there's the actual shiftregister into which the data is shifted bit-by-bit as it's received. You don't have access to this register (AFAIK).
    Once the correct number of bits have been shifted...
  21. Re: PBP LONG and string-formatting not working ?

    That's weird. I'm working on a large project right now, have LONGs enabled and, except for one thing*, have not noticed any such problems. Have been using DEC, BIN, HEX extensively.

    You show a...
  22. Replies
    12
    Views
    622

    Re: USB to send ASCII characters to PC

    It can. What you're looking to do is basically implementing a USB keyboard using USB HID. When connected it will, to the PC, look like any old USB keyboard. I've managed to do it using examples on...
  23. Re: Make PIC simulate binary up/down counter - how to calculate how fast can it count

    We had a similar discussion not that long ago, might be worth revisiting.
    It's important to remember that one usually want to do more than JUST keep track of an enocder and that has to be accounted...
  24. Replies
    5
    Views
    360

    Re: Need help with 16F676 button press

    I have a hard time believing that was the actual problem. In PBP (unlike, for example, C) = and == are the same thing. And you basically have the proof in your own code sine the WHILE loop works and...
  25. Re: Anyone worked with reading a sine/cosine encoder?

    With a 10bit ADC (like most PICs have) and a VRef of 5V you get a (theoretical) resolution of 4.88mV. Your typical sin/cos type encoder outputs 1Vpp which means that (again, in theory) you should be...
Results 1 to 25 of 100
Page 1 of 4 1 2 3 4