Search Results - MEL PICBASIC Forum


Search:

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

Page 1 of 4 1 2 3 4

Search: Search took 0.00 seconds.

  1. Re: Can you use the same pin as input/output and control led load?

    I think it is better to upload what is in my mind.
  2. Can you use the same pin as input/output and control led load?

    I want to confirm if one pin can be an input and later when needed can be made an output and high/low as needed?

    It's just that when an input, it will have 2.5 volt on it through a voltage divider...
  3. Replies
    1
    Views
    2,273

    Is a 'GOTO' Or a 'GoSub'?

    If I have a statement like below:

    I2C_Routine:
    I2CWRITE SDA,SCL,$36,[Loc], Fail
    Return

    The jump to the label Fail is executed as a Goto or a GoSub instruction at the end of the above...
  4. Replies
    42
    Views
    21,683

    Re: Soooooo Close

    Success but with one question.
    Finally, I put 20MHz clock. It started working with absolutely no problems.

    This leaves me with one MAJOR question - Is there any way, I can run the whole show at...
  5. Replies
    42
    Views
    21,683

    Soooooo Close

    I just discovered, that the I am actually receiving only 1 byte as expected. Rest are just "Start......"13,10 and "Done",13,10. Yesterday got too exhausted and missed this mistake of mine.

    Here is...
  6. Replies
    42
    Views
    21,683

    Re: I2C CONFUSION, Help needed please

    Did the above, no luck.
    Doesn't like it straight, giving it $37/$36 direct sends it to Fail1 routine. So write statement fails.

    Funny thing is that when it goes to Fail1, though there should be...
  7. Replies
    42
    Views
    21,683

    Re: I2C CONFUSION, Help needed please

    The manual says do not use constants for address.
    Though I tried the above but the result is the same.

    While 1 : Wend - I just put this just like that to halt the code.
  8. Replies
    42
    Views
    21,683

    Re: I2C CONFUSION, Help needed please

    Still getting the same with the following code:


    Value Var BYTE
    Addr Var byte
    Loc Var Byte
    '---------------------------------------------------------
    Pause 500
    DEBUG "Start......",13,10...
  9. Replies
    42
    Views
    21,683

    Re: Update

    Better in nibble setting. I can see '2E' repeated a few times.
  10. Replies
    42
    Views
    21,683

    Update

    Have a look at my real term serial monitor. I am actually getting a lot of unexpected data which I don't understand how is getting stored in just one byte. Though among all this, I can see '2E' (but...
  11. Replies
    42
    Views
    21,683

    Reaching there

    I did exactly the same as above and the sequence completed fine. BUT the values are not consistent with the datasheet, I should get '$2E' from location 0, but WHATEVER location I try to read, I am...
  12. Replies
    42
    Views
    21,683

    Re: I2C CONFUSION, Help needed please

    Fails on the second statement if I swap the values of Addr. i.e. First $37, second Addr $36. First one goes fine.
  13. Replies
    42
    Views
    21,683

    Re: I2C CONFUSION, Help needed please

    Checked it. It fails on the first write statement.
  14. Replies
    42
    Views
    21,683

    Re: I2C CONFUSION, Help needed please

    How do I implement this, like this below?

    Main:
    High Led : Pause 500: Low Led : PAUSE 500
    Addr=$36
    I2CWRITE SDA,SCL,ADDR,LOC
    Addr=$37 : pause 10 ' OR If SDA=1 then main ...
  15. Replies
    42
    Views
    21,683

    Re: I2C CONFUSION, Help needed please

    I read it again to confirm this, the attachment is my source. It also mentions 9 bits long address. Not sure who sends an ack. I see that in read statement the device send ack, so why add it to the...
  16. Replies
    42
    Views
    21,683

    Re: I2C CONFUSION, Help needed please

    Picked up from the datasheet of the device. That is what I understood, am I wrong?
    Though I did tried $3B & $5B.
  17. Replies
    42
    Views
    21,683

    Re: I2C CONFUSION, Help needed please

    OSCCON changed to set 4MHz, internal oscillator.
    I2CSLOW 1 stays commented
    I2CHOLD 1 stays commented


    LED Var PortC.0
    Value Var Byte
    Addr Var Byte
    Loc Var Byte...
  18. Replies
    42
    Views
    21,683

    Re: I2C CONFUSION, Help needed please

    Tried this:


    Pause 500
    DEBUG "Start......",13,10
    Value=0
    Addr=$9B
    Loc=0

    Main:
  19. Replies
    42
    Views
    21,683

    Re: I2C CONFUSION, Help needed please

    Steps Taken:

    1) Configuration changed: _INTRC_OSC_NOCLKOUT
    2) Made 16f688 run at 8MHz : OSCCON=%01110001
    3) Commented DEFINE I2CSLOW 1
    4) Value changed to BYte (then to word again)

    I get a...
  20. Replies
    42
    Views
    21,683

    Re: I2C CONFUSION, Help needed please

    I added two bytes - Addr & Loc
    Addr=$1B
    Loc=0

    Sent - I2CREAD SDA,SCL,Addr,Loc,[Value],Fail

    No Luck :(

    '-----------
    What is also confusing me is the control byte in the manual, the device...
  21. Replies
    42
    Views
    21,683

    Re: I2C CONFUSION, Help needed please

    My Code is this:


    PortC.2 keeps toggling along with normal LED.

    I have also attached the device datasheet. I really appreciate the help in this.
  22. Replies
    42
    Views
    21,683

    Re: I2C CONFUSION, Help needed please

    Yes, pull ups are there @ 3.2k.
    I tried the statement : I2CREAD SDA,SCL,$1B,0,[VALUE] (is it correct? because I don't had any luck)
  23. Replies
    42
    Views
    21,683

    I2C CONFUSION, Help needed please

    I am trying to communicate with an I2C device. I have done almost everything I could think of but it is not working. The manual mentions stuff but not exactly matching with the datasheet of the...
  24. Re: Need some advise on making two PICs communicate to each other

    Thanks M8. Got one more for you.
    I have 4 slaves, lets say they all have RJ45 type connector (for easy application). So one wire comes out from them, 4 in total.

    How does one master connects...
  25. Re: Need some advise on making two PICs communicate to each other

    Do these RS485 cables connect to RJ45 connectors? (I am sorry this is my first time with them)
Results 1 to 25 of 83
Page 1 of 4 1 2 3 4