Search results

  1. G

    If statement not working as expected

    It seems to me that it may be compiler limitation where a single "IF" can only test one Boolean expression. The first Boolean expression is evaluated correctly, however the second one is ignored/missed.
  2. G

    Help with finite state machine please

    I asked ChatGPT to provide example code in BASIC that demonstrates a Finite State machine. Here it is ' Finite State Machine Example in BASIC ' Define state constants Const STATE_A = 1 Const STATE_B = 2 Const STATE_C = 3 ' Initialize current state variable Dim currentState As Byte...
  3. G

    Control motors and servos at the same time

    That is exactly will happen if you use "servo" and "hpwm" in one integrated code program, as they share the same timer. Each time servo is called it will change the settings for HPWM. Therefore they cannot run concurrently. One or both will fail. This is not a PIC limitation but a...
  4. G

    Control motors and servos at the same time

    Welcome. Perhaps describe your application a bit better. What is it? The more folks know about what you are trying to accomplish the better the help will be. Unfortunately per Manual 2 ( Servo) page 220 under Information: "Servo cannot be used at the same time as timer or pwmout/hpwm...
  5. G

    adc resolution on picaxes, down to 100mV

    Picaxe chips can have an ADC resolution of up to 10-Bits. If the reference voltage is 4.096 that is 4 millivolts per step over the range of 0 to 4.095 volts. Perhaps word your question in a different manner as it is unclear to me as to what you are trying to acomplish
  6. G

    Power Supply Integration

    These breadboard Power Supplies are very nice and produce clean outputs of both 3.3V and 5V. However the on/off switches tend to have a high failure rate ( from my personal experience). The latching mechanism fails , where the switch will not stay in the on position . Sometimes cleaning the...
  7. G

    LED Current Limiting Resistor Value

    Personally I would only use the maximum current ( minimum resistance) if I wanted to blind myself (and others) with an LED. I size the resistor based upon the brightness level desired for the particular color and specific type of LED. As a general rule I use the minimum current ( max...
  8. G

    I keep trashing input trim potentiometers-thoughts

    I would think that a common snubber of 100R/.1u across the relay contacts should be sufficient to prevent contact arcing at turn off. A QuenchArch P/N 104M06QC100 Costs about $10 US. Or make one (or 2) yourself with the properly rated components. Goey
  9. G

    Generating code with ChatGPT

    A friend of mine asked ChatGPT to write some code in GCB the question was: Help me with programming an LCD in Great Cow BASIC" ChatGPT Responded with: Sure, I'd be happy to help you with programming an LCD in GCBASIC. Here is an example of a basic program that will write "Hello, World!"...
  10. G

    28x2 Resonator Pins

    This is a Picaxe limitation not a silicon limitation. The config bits are written whenever the flash program memory is written. In the case of a Picaxe, this is during "production programming ", meaning when the firmware is flashed onto the chip not when the actual PIC chip is...
  11. G

    I keep trashing input trim potentiometers-thoughts

    I see nothing in the schematic that would cause a potentiometer failure. However, do add the pull down resistor and you might want to add a 20uF electrolytic bulk capacitor somewhere on 5v line. Close to the Picaxe if possible. My guess is either a wiring issue or not measuring the pots...
  12. G

    SPIIN in Picaxe 40X2

    Looks like a firmware bug crippling the HSPI functionality of this Picaxe chip. @hippy Can you confirm whether on not this is a bug ? Maybe test on silicon ?
  13. G

    low voltage (1.8vlts) output from pin - when set high?

    1) Are the batteries at acceptable levels ? Measure the voltage between the Picaxe +V and 0V pins. What is it ? Does it change when the program runs? 2) Disconnect everything from the Picaxe except the batteries. Let the program run and check the 'high' voltage on B.3 again. Did it change...
  14. G

    SPIIN in Picaxe 40X2

    Let's assume a firmware bug where the 40x2 inverts the bits relative to the 20x2. You are using "MSBPre_L" as the mode that works on the 20x2. This is idle low. Why not try "MSBPre_H" on the 40x2 and see what happens ? If the firmware has idle low and idle high reversed on the 40x2 then...
  15. G

    SPIIN in Picaxe 40X2

    Seems to me that with the exact same code using the same pins that the result would be the same. Possibly the firmware has a bug where the idle state is inverted on the 40X2 ? f you can't get anywhere with this, why not try using HSPIIN/HSPIOUT instead of bit-banging with spiin/spiout. I...
  16. G

    The mystery of "bit banging"

    Well done. This is the same result I got when using "fastest" with a 14M2 as I did not have the luxury of "<<" or ">>" with this chip. I only tested with the fastest method , but added delays to get to 4800 baud. (9600 not doable) due to command latency. This code prints Hello World...
  17. G

    The mystery of "bit banging"

    When I think of bit-banging I think of making software do what is commonly done in hardware. Like "software serial". This is bit-banged internally by the Picaxe Firmware (serout/serin) as it does not use a hardware UART. It works quite well. Bit-banging software serial using Picaxe Basic...
  18. G

    Can I use Arduino IR codes from their mini remote to work with the picaxe ?

    Hex is simply a way of displaying and working with a number. A hex value of FFA25D consists of 3 bytes of data In decimal terms it would be 255,162,93. So as far as the software goes it does not matter if the code is looking for $FF or DEC 255. It's the same value. Many folks prefer to work with...
  19. G

    Adaptability of picaxe

    My first few microcontroller projects were Picaxe based and worked well. I was an electronics tech (mostly analog stuff) and not a programmer, but I learned Picaxe BASIC and became somewhat proficient with it in a short time. Then I came upon a project that required reading a 50Khz signal...
  20. G

    Adaptability of picaxe

    More sophisticated chips are for more sophisticated applications and will likely need more sophisticated code. Picaxe "libraries" (chunks of code) are built into the internal interpreter and are not not accessible to the user. For example, hardware serial. Do Picaxe users really understand...
Top