Search results

  1. hippy

    DS18B20 parasite power

    When a DS18B20 initialises; its temperature reading register is set to 85 as a default. When the device has its temperature requested it should take a temperature reading, perform its conversion, update its register, which is then read by the PICAXE. Getting 85 back means that the DS18B20 is...
  2. hippy

    08M2 pwmout 0,1

    The firmware treats "PWMOUT 0,x" as if a "PWMOUT OFF" command, hence what you are seeing. It should be possible to "POKESFR PR2, $00" to set a zero value duty. Symbol PR2 = $1B ; $01B After that I believe "PWMDUTY C.2, 2" should set 50% duty. So in full, this will hopefully work. Untested...
  3. hippy

    Macros within IF commands

    Token sizes vary, depending on what the token represents or what its value is. Generally there needs to be X-bits to represent N different things, so if one had 8 commands one might have 3-bit command tokens - 000 LET 001 HIGH 010 LOW 011 IF 100 GOTO 101 GOSUB 110 RETURN 111 END But one can...
  4. hippy

    Macros within IF commands

    Thanks. I think it is an anomaly. If you add a STOP command at the end after the LOOP, with "b0=0" that's 65 bytes, with "b0=b0" it's 66 bytes. I recall it comes down to the way the compiler counts bytes used that it can be an off by one depending on how the code aligns in memory.
  5. hippy

    Can someone help me with the maths, Please!

    It should be working without any incremental speed-ups. You could check it does work smoothly with - Do For w0 = 340 To 1024 adcvalu=w0 adcvalu=adcvalu-340 adcvalu=adcvalu*15/10 PWMDUTY B.4,adcvalu Pause 10 Next For w0 = 1023 To 341 Step -1 adcvalu=w0...
  6. hippy

    spiin versus bit-banging

    It's all a bit odd but I'd suggest sticking with SPIMODE11 and see how it goes. I would also change the Tx($EF) to "Tx(b20) : b20=b20+1" just to check the numbers do increment every loop.
  7. hippy

    spiin versus bit-banging

    It does seem odd that SPIMODE00 and SPIMODE11 seem to deliver the best results as they put out very different signals. It is notable that status with SPIMODE00 is different on the read "00=0,0,0, while SPIMODE11 is a consistent "0F=0,0,15". I would say the later is more likely correct. It's...
  8. hippy

    spiin versus bit-banging

    That looks right, given the bug I belatedly spotted, seems to confirm the chip latches on rising edge. Using SPIMODE01 SPIMODE10 would seem to be the best option for HSPI. That starts with SCK high which seems required when we bring CSN low, and keeps bit 0 of the last byte sent on the bus...
  9. hippy

    spiin versus bit-banging

    Good point about that code leading to the register accessed being $35; I had forgotten to take that into account and your analysis is likely correct. I think we can already conclude the chip latches on SCK going high but to confirm it you can try this - Do_TxRx: pinMOSI = 0 : bit7 = pinMISO...
  10. hippy

    Macros within IF commands

    It would be interesting to know where you are seeing that, using which software and which PICAXE. I suspect it is an anomaly because the token for a numeric zero should be smaller than for a variable.
  11. hippy

    Use of RFID RC522

    I'm not sure how true that will be and it really comes down how many are wanting to use that tech. The PICAXE was never intended to be able to do everything and it has always been acknowledged that there will be some things it will not be able to do, and probably never will. This may be one of...
  12. hippy

    Is Hserin really this slow?

    Possibly but perhaps not. Firmware differs between commands, versions, chips and families so, that it's an issue in one case, doesn't necessarily mean it will be an issue in others. Apart from checking the revision history for the particular chip the only way to tell if there is an issue is to...
  13. hippy

    Is Hserin really this slow?

    The only thing I can think is that with "PeekSfr <adr>, @bPtrInc", the firmware is seeing the destination as @bPtrInc, is applying an increment, is reading the SFR, storing it where bPtr now points to and, seeing it is @bPtrInc, is applying another increment. I don't have an 18M2 to hand but...
  14. hippy

    Is Hserin really this slow?

    If a PICAXE is sending I would recommend testing with just one character sent with a one second gap between them and see how that goes. Perhaps with a modified SERTXD - SerTxd("Got",TAB, #bit7,#bit6,#bit5,#bit4,#bit3,#bit2,#bit1,#bit0,TAB,#b0,TAB,b0,CR,LF) Then start to increase the number of...
  15. hippy

    Is Hserin really this slow?

    There is something odd going on if HSERIN is missing characters at 4800 baud when run at 32MHz. At 4800 baud a byte will be received every 2ms or so and the HSERIN loop will almost certainly have executed within that time at 32MHz. Even a SERTXD of a byte at 38400 baud at 32MHz ( 4800 at 4MHz...
  16. hippy

    spiin versus bit-banging

    I realised there is a way to tell whether the CC1101 is latching on the rising edge of SCK, as the datasheet appears to indicate, or the falling edge. Use the bit-banged code in Post #15 with the Do_TxRx subroutine replaced with the following - Do_TxRx: pinMOSI = 0 : bit7 = pinMISO : High SCK...
  17. hippy

    spiin versus bit-banging

    Is that genuinely SPIMODE00 or a typo ? If it is SPIMODE00 that is odd. Mode 00 raises its SCK before setting MOSI, expecting the slave device to sample on the falling edge of SCK ... ___ ___ ___ SCK ___| |___| |___| |___ _______ _______ _____ MOSI...
  18. hippy

    spiin versus bit-banging

    Not a lot out there, but I did find some useful information along the way. First thing is the CC1101 is a 1V8-3V6 device and is reported to be rather sensitive to supply fluctuations, isn't tolerant to 5V - Weird things can happen at 5V. Are you running at 5V ? The power-on start-up sequence...
  19. hippy

    Is Hserin really this slow?

    I think what happens on older Windows versions, when one asks to be woken up in 5ms, Windows put the program to sleep for a minimum 'clock tick' and that used to be something like 18ms. These days it's not entirely clear how long a 'clock tick' is and it does seem to vary depending on OS...
  20. hippy

    spiin versus bit-banging

    Glad the bit-banging works. It would now be worth trying HSPI. That just requires the "Do_" routines to be replaced ... Do_Init: High CSN Low SCK Low MOSI Input MISO HSpiSetup SPIMODE01, SPISLOW ; <-- May have to tweak this Return Do_Start: Low CSN If pinMISO <> 0 Then...
Top