Search Results - MEL PICBASIC Forum


Search:

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

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    2,744

    Re: RTC with date and EEPROM

    That EEPROM is certianly big enough. I'm sure there are a number of options, just depends on cost vs. what mets you needs for size/package/interface/etc.

    What is the 'Best' thing for storing...
  2. Replies
    3
    Views
    2,744

    Re: RTC with date and EEPROM

    You ask about a "256KB EEPROM", but do you mean 256Kb? (Like the 24LC256?) If so, there is no way that would be big enough to hold all of the data. It only holds 32,767 Bytes. For your task, you...
  3. Thread: CON vs. =

    by SteveB
    Replies
    6
    Views
    3,489

    Re: CON vs. =

    You are correct, constants use no RAM, but variables use RAM space depenedent on their type.
  4. Thread: CON vs. =

    by SteveB
    Replies
    6
    Views
    3,489

    Re: CON vs. =

    So, if I understand the question, “Is there a difference between the following code snippets?”


    MyByte VAR BYTE
    MyByte = 155

    MyByte VAR BYTE
    MyCon CON 155
    MyByte = MyCon
    The answer is: No.
  5. Replies
    6
    Views
    7,772

    Re: Big Digits on 4x20 LCD

    Looks good!
  6. Thread: LCD BARgraphs

    by SteveB
    Replies
    232
    Views
    206,770

    Re: LCD BARgraphs

    Untested, likely needs some debugging, but at least the methodology should be clear.


    LCDPos VAR BYTE
    volts VAR WORD ' 0 to 500 representing 0 to 50.0 Volts
    Amps VAR BYTE ' 0 to 50 representing...
  7. Replies
    5
    Views
    5,330

    Re: I2C question w/ MCP23017 Port Expanders

    The I2C protocol shouldn't work open loop. The slave must send an ACK after each byte that is written. I would be very surprised if the PBP routines for I2C were written in a way that did not wait...
  8. Replies
    6
    Views
    7,214

    Re: 16F1847 Usart and I2C

    Seahound,
    Take a look at the table (Table 1) on page 4 of the datasheet.
    From what I can see, you can move the RX pin for the USART from RB1 to RB2. The SDA1 for I2C can not be moved, and is on...
  9. Replies
    3
    Views
    5,052

    Re: Need guide to start working on weather meters

    Correct, count the number of pulses. Each pulse = .011" (.2794mm) of rain. This could be done with a general IO interrupt, or just poll it frequently if your main loop is quick and the pulse length...
  10. Replies
    2
    Views
    2,608

    Re: bit position variable

    I think this is what you are getting at.


    WriteByte VAR BYTE
    LED32 VAR WriteByte.3

    LED32 = 0

    But, lets say that this LED is actually attached to pin 3 of PORTB. In this case,...
  11. Thread: Do Loop

    by SteveB
    Replies
    13
    Views
    7,737

    Re: Do Loop

    For what you are doing, you can also use this method:


    WaitForDoor:
    IF DoorOpen <> 0 THEN WaitForDoor
  12. Re: Counting RPM's with Interrupt? Speed Limitations?

    Yes, a PIC is more than capable of interrupting at that frequency. The problem will be the reed switch.
    If you use an un-bounced reed switch, you will likely catch a lot of bouncing, and the PIC...
  13. Re: Working code but my layman approach uses too much code space

    Like Henrik said, the formula is really subtracting 4000 from a WORD. So here's the way I tackled it:



    wCalc VAR WORD
    G3T VAR wCalc[0]
    G4T VAR wCalc[1]
    IF wCalc <4000 THEN ...
  14. Replies
    13
    Views
    8,580

    Re: 24LC256 wrong address at reading

    Sorry, didn't mean to come across that way, just wanted to make sure my explanation was clear.;)




    Not sure why [STR TEXT\5] didn't work, it should have. :confused:
  15. Replies
    13
    Views
    8,580

    Re: 24LC256 wrong address at reading

    addr var WORD

    For addr = 0 TO 5 '
    I2CRead memSDA,memSCL,$A1,addr,[STR TEXT\6] '$A0 does the same as $A1
    pause 10
    Next addr


    Lets look at what...
  16. Replies
    13
    Views
    8,580

    Re: 24LC256 wrong address at reading

    Fanis,
    Did you solve the problem?


    I2CRead memSDA,memSCL,$A1,3,[text]

    FYI, the "3" here is a constant, and is going to cause problems, since the 24LC256 needs a WORD addr.

    try:
  17. Replies
    13
    Views
    8,580

    Re: 24LC256 wrong address at reading

    One other item. You have this comment: '$A0 does the same as $A1

    I'm assuming this is a reference to the "Control" byte in the command.

    The reason for this, is that the control byte for the...
  18. Replies
    13
    Views
    8,580

    Re: 24LC256 wrong address at reading

    One thing I see, is you keep writing over the top of the array "TEXT". Also, you don't need the FOR...NEXT loop to read sequentually.

    Try just this:

    I2CRead memSDA,memSCL,$A1,addr,[STR...
  19. Replies
    772
    Views
    589,630

    Re: Instant Interrupts - Revisited

    The code could also be changed thus, not that it makes a difference:


    T1PS = 1 ; start with 1:1 postscaler
    TimerConst = ((OSC*1000000)/4/100)+8 ; how many timer ticks...
  20. Replies
    772
    Views
    589,630

    Re: Instant Interrupts - Revisited

    Darrel,
    While poking around and getting ideas, I got to looking at ver 1.2 of "Elapsed_INT-18.bas". I was particularly interested in the nice routine to calculate the timer reload constant:


    '...
  21. Replies
    9
    Views
    4,533

    Re: Problem with PortB Tris

    Here are some things I’d look into changing or using now that I look at it again. First, some easier changes:

    - Not so much a change to the routines, but in how they are called. Use the new...
  22. Replies
    9
    Views
    4,533

    Re: Problem with PortB Tris

    FWIW, here is an include file I put together (a long time ago) to use the Hardware I2C. It may be useful. It uses arrays as buffers to input and output data.
    6749
    It uses arrays as buffers to...
  23. Thread: LCD BARgraphs

    by SteveB
    Replies
    232
    Views
    206,770

    Re: LCD BARgraphs

    Thanks Darrel. :D
  24. Replies
    9
    Views
    4,533

    Re: Problem with PortB Tris

    Glad to see it get fixed!


    You might look into using the hardware I2C. You'd have to write some routines to deal with the data, but it will work well once you do.
  25. Replies
    9
    Views
    4,533

    Re: Problem with PortB Tris

    I don't have an answer, just a quick suggestion to trouble shoot. Try putting another TRISB = %00010000 between the FOR...NEXT loops and see what that does. Also, if you use PORTB.6 = 1...PORTB.6 =...
Results 1 to 25 of 100
Page 1 of 4 1 2 3 4