Jump to content

DrStein99

EstablishedMember
  • Content Count

    43
  • Joined

  • Last visited

Community Reputation

0 Neutral

About DrStein99

  • Rank
    Regular

Profile Information

  • Gender
    Male
  1. I can't figure out how to modify the last for bits of an integer, and leave the first 4 alone. I know I can use the bitwise to toggle on or off, and the OR statements, and NOT will reverse. So if the first four bits are inputs, and the last four are output, I want to modiy/write over the outputs and leave inputs alone.
  2. Ok. That makes alot of sense. I was testing with thumbsweels pulled from broke monitors, and car-stereos - and I think they are mechanical, not optical; causing some type of spike feedback, and 1/2 way results. When I trigged it and watched using a LED it goes so fast I cant sense what its doing. I think I need to get an oscilliscope of data-logger of some sort so I can actually tell what's going on.
  3. Do you know if thumbs-wheels are setup differently then encoder-wheels? I believe mine seems to pulse every time i click it in either direction. Now am I supposed to count the change from 0 to 1 and then back to 0, as an event, or just change from 1 to 0, and ignore the change back to 1 ? I'm starting to become confused again, as the thumbswheel registers "1" at idle and then starts pulsing 0's from the A and B leads when I click the wheel.
  4. Thanks for the info. I got it working by comparing the first bit value against the old-bit, and then comparing the first bit to the 2nd bit. Now as long as the encoder will always report data in that order, it should be accurate. (code example, "RBA" is encoder A, "rbB" is 2nd encoder B, "boORBa2" is the last condition of "RBA" if (rbA==boRBa2) //old are same { if (rbB==rbA) cSpeed=2; //new are equal, then its direction "B")backwards else cSpeed=1; //new NOT equal, then its direction "a")forward } else //old are NOT the same { if (rbB==rbA) cSpeed=1;// old are NOT the same, but the new are - so "A")forward. else cSpeed=2; } boRBa2 = rbA;
  5. I just checked. I can find no setting other then "2 state buttons" on the config screen for the button-block plugin.
  6. If anyone has links for interpreting encoder signals using a pic16f628 it would be appreciated, please. I'm having trouble trying to figure out how to handle accurate change in direction with the stepping.
  7. I can see the "two-state" setting, and am using that. I may have something wrong (an outdated plugin possibly??), all I recall seeing on my version is a setting for "two-state". I do not see an option to short high/low. Is that option hidden somewhere other then next-to or around the "two-state" setting?
  8. Wow ! I was looking for a tutorial like this; very informative - thank you very much! I was recently having some trouble figuring out math and operators, but your section for: "Lesson 5: Operators and Integer operations" clearly answers alot of questions I was looking for. Reading lengthy books, and padded and long online tutorials makes my head hurt, but your short summaries do justice! Very good indeed!
  9. Ok.... I'm testing bit values for portb, when they trigger "0" (BUTTON PUSHED), using a 10k resistor from the +5v, and grounding the pin to trigger a button push on the device. Good. All ok here. So.... When I put the "button block" plugin on the simulator, the portb seems to default to all 0's, even if I change portb = 0xff! I have to press the buttons down and then press them back up again to register as 1's, during program operation, and to trigger them, I have to press them back again to signal 0. Is the button block plugin completely backwards or what ELSE am I doing wrong here? Please advise.
  10. This method of mirroring the port sounds simular to back-buffering video animation frames to avoid flickering. I think I am familiar with this. If the port value is = "1101', and I can write "0111" without the entire port zeroing-itself out, inadvertantly; using mirroring. So to clairify; whenver I modify port values, I am to populate a variable from the port, modify the VARIABLE, and then post the variable back to the port - yes? --- That bit-flipping will help me too; I already saw my program was subtracting "8" from the port TWICE, causing terrible issues - this method will definately help. Thanks for the prompt response and helpful advise!!!
  11. When I do: set_bit(porta,2) -or- clear_bit(porta,2) Does that interfear with any other bits I have on the port? I'm trying to "set_bit" and "clear_bits" on #2 and #0, and on other parts of the program I'm using bits 1 and 3, and triggering them using math: porta += 8; -or- porta += 2; -or- porta -=8; -or- porta -=2; ---------- Is there something wrong i'm doing? Please advise.
  12. Ok I now understand all this, is clear now. Thanks for the info, i appreciate it!
  13. When I set the timer to a prescaler - 1:8, does that mean every 8 crystal cycles, and 1:1 would be each cycle? So I can do the math on my oscilator value, to figure how often to trigger the interrupt, Yes? ---- The datasheet explains how I can set all this up, however I lack understanding in what a PRESCALER is, and how that ratio is triggered by the math of the oscilator. If anyone knows any helpful SHORT tutorials on this, I would appreciate the link - please.
  14. buddy - have you gotten your blink-led program to work yet?
  15. Its frusterating enough going thru all that needs to be involved to get things to work, let alone - misleading information that is othwise trusted. No answer is better then wrong answers.
×
×
  • Create New...