Search Results - Proton BASIC community web site


Search:

Type: Posts; User: barak

Page 1 of 4 1 2 3 4

Search: Search took 0.03 seconds.

  1. Re: ADC alternative way to capture Data using nbuilt Fix voltage reference

    Check this code example: http://www.protonbasic.co.uk/content.php/2263-ADC-with-built-in-Scaling-on-PIC-with-FVR
  2. Replies
    5
    Views
    55

    Re: Can some kind soul explain this

    Here is an example from some time ago:
    http://www.protonbasic.co.uk/content.php/1980-ADC-interval-with-Special-Event-Trigger
  3. Re: Detecting for the presence of pulses not using interrupts

    You can connect each fan to an I/O and all the fans via diodes to one Interrupt input (Cathode to fan all Anodes to INT) .
    When you get an interrupt, check the I/O's to find which fan(s) does it.
  4. Replies
    3
    Views
    16

    Re: nrf24L01 Bi-directional communication

    If you are referring to"ack with payload" then the PRX (master) first needs to get a transmission from the PTX (slave):
    1) the PRX can only send "ack with payload" back to a PTX in response to...
  5. Replies
    16
    Views
    49

    Re: Support for Les... a change of heart?

    OK. Sent you some. hope more will follow so you can continue the good work. I agree the link to donate should be taken out of the thread and placed somewhere more noticeable.
  6. Replies
    4
    Views
    16

    Re: What Devices Does Proton Support?

    http://www.protonbasic.co.uk/content.php/1878
  7. [SOLVED !] Re: Help, I need use USB with internal oscillator INTOSCIO in 18F25K20

    What version are you using? For me version 3.5.9.3 fixed this problem
  8. Replies
    20
    Views
    596

    Re: Using TMR0 with PIC 18F26K22

    tic = 1/64 * 4 * 256 = 16uS
    period 1 Sec
    Required timer value 2^16 - (period / tic) = 65536 - 62500 = 3036

    The max. period possible at this clock speed with the prescaler at 256 is 1.048576 Sec...
  9. Replies
    20
    Views
    596

    Re: Using TMR0 with PIC 18F26K22

    OK here is a working hardware tested code. All you have to change is device (I only had 25K22) and the number of seconds you want for the LED to turn on (I have it on 10 seconds as I'm not patient...
  10. Replies
    20
    Views
    596

    Re: Using TMR0 with PIC 18F26K22

    I'll try it and let you know
  11. Replies
    20
    Views
    596

    Re: Using TMR0 with PIC 18F26K22

    Sure he will need that and possibly interrupt priority. I'm assuming he will define all the standard items and configure the device. Its just a timer 0 example taken out of working code but is was...
  12. Replies
    20
    Views
    596

    Re: Using TMR0 with PIC 18F26K22

    '----------------------------------------------
    ' example for 18F4xK22 Timer 0
    ' interrupt every 1 sec at FOS 64MHz
    ' every 60 seconds, turn on a LED for 1 second...
  13. Replies
    20
    Views
    596

    Re: Using TMR0 with PIC 18F26K22

    In this clock speed there is no way to get a timer to do 1 minute! The maximum possible timer period is 1.04858 Second at prescaler = 1:256.
    If you want 60 seconds you need to count 60, 1 second...
  14. Replies
    20
    Views
    596

    Re: Using TMR0 with PIC 18F26K22

    His code is for 16f and he wants to know how to run tmr0 on 18f which does not use the option reg
  15. Replies
    20
    Views
    596

    Re: Using TMR0 with PIC 18F26K22

    What is the osc speed in your application?
  16. Re: New Project _ Source Meter and measuring small currents

    I'm assuming it is an adjustable power supply. On the display you show the voltage after the sense resistor. This has to be this way because this is the actual voltage going to the load. You don't...
  17. Re: New Project _ Source Meter and measuring small currents

    If you have a high side circuit, why do you care about the voltage drop? The voltage drop is an issue with low side current sense because of the difference to real ground but it is not an issue with...
  18. Re: New Project _ Source Meter and measuring small currents

    177 or 197A. There is a risk they will not work well because they are so old but I think its worth it barbecue when they are in good shape they are so accurate.
  19. Re: New Project _ Source Meter and measuring small currents

    Because it is a high side circuit for low load, you can use much higher resistance for your max. load. you don't need miliohm resistance. Even 1 ohm will give you enough current for a few hundred mA....
  20. Re: New Project _ Source Meter and measuring small currents

    The ADC is not as critical. You need an Integrated Differential Amplifier https://www.maximintegrated.com/en/app-notes/index.mvp/id/746
  21. Replies
    9
    Views
    251

    Re: COUNTER command on an SFR bit

    How often do you need to know if > 5KHz? If you can use a "window", use a timer with an interrupt and an interrupt "counter" on the comparator as suggested before. the counter is byte size. If the...
  22. Replies
    5
    Views
    302

    Re: Using harware SPI

    Correct. As soon as you put data in the buffer (SSBUF) it is being clocked out and "simultaneously" the data from the slave is clocked into the buffer.
  23. Replies
    5
    Views
    302

    Re: Using harware SPI

    Example:


    SPI_WR:
    Pop SSPBUF
    While SSPIF = 0 : Wend ' wait for end of transaction
    SSPIF = 0 ' clear the SSP flag
    Return SSPBUF

    yourcode:
  24. Replies
    11
    Views
    648

    Re: Waveform generator

    The screen shots are with the DDS code I posted with a very simple 2nd order RC LPF. The sines are nice and frequency very accurate. After measuring i realized my table was almost full scale and that...
  25. Replies
    11
    Views
    648

    Re: Waveform generator

    I got some screen shots with FFT from the scope that show 100Hz, 1KHz and 10KHz that will give you an idea of the harmonic distortions. See attached. The red line is the FFT with markers on the...
  26. Replies
    11
    Views
    648

    Re: Waveform generator

    This is one of the most confusing title to an AN. Per page 6 their solution is: "Thesquare wave output from the NCO can be passedthrough a Band Pass Filter with a high Q factor togenerate a sine wave...
  27. Replies
    11
    Views
    648

    Re: Waveform generator

    If you can use a square wave, I think the best hardware on a PIC is NCO. See http://www.protonbasic.co.uk/showthread.php/66605-NCO-to-forum?p=506132&viewfull=1#post506132
  28. Replies
    11
    Views
    648

    Re: Waveform generator

    Try the attached. It uses 18F23K20 to generat sine waves. Needs a LPF on the PWM output
  29. Replies
    23
    Views
    1,369

    Re: Runtime symbol or variable assignment

    why not just save a few lines and do:


    Select POSITION
    Case 1
    High = porta.0
    Low = porte.0
    High = porte.1
    Case 2
    High = porta.1
  30. Replies
    23
    Views
    1,369

    Re: Runtime symbol or variable assignment

    take a look at the code I posted below. Very quick, don't need conditional code.
  31. Replies
    23
    Views
    1,369

    Re: Runtime symbol or variable assignment

    Try this:


    Pin_Output = 1
    Pin_Output = Pin_Output << (POSITION - 1)
    PORTA = PORTA & 0xF8 ' PORTA[2:0] = 0
    PORTA = PORTA | Pin_Output
  32. Replies
    53
    Views
    10,347

    Re: SPI GLCD Help needed

    I used Fontconverter.exe but can't remember where I got it from and how it works (too old)
  33. Replies
    53
    Views
    10,347

    Re: SPI GLCD Help needed

    It does not appear relater to the solution on this thread
  34. Replies
    53
    Views
    10,347

    Re: SPI GLCD Help needed

    My fault. I did some tests with 18F45K20 so I commented the original sub (see in code below) and forgot to change it to 'Pop SSP1BUF' . The compiler is forgiving and permits 'SSPBUF' although...
  35. Replies
    53
    Views
    10,347

    Re: SPI GLCD Help needed

    Why did you define SI and SK? If using the MSSP it is not needed.
    The SPI sub should be changed to send the buffer of MSSP2:

    SPI_GLOBAL: ' generic SPI sub ...
  36. Replies
    53
    Views
    10,347

    Re: SPI GLCD Help needed

    Sorry, I thought you are using 46K22. The 81F26K22 is OK and the code should work.
    So on the 26K22 you have the LCD connected to MSSP2.
    I noticed you have a keypad on port B but also using it for...
  37. Replies
    53
    Views
    10,347

    Re: SPI GLCD Help needed

    If the SD card is Using SPI, you can use the same MOSI and SCK for both the SDCard and the LCD. Unless you pull down the Chip Select (CS1B on the LCD), the device will ignore the communications. Even...
  38. Replies
    53
    Views
    10,347

    Re: SPI GLCD Help needed

    the code at http://www.protonbasic.co.uk/attachment.php?attachmentid=3145&d=1476265849 is for PIC18F46K22 but it is using the MSSP1 module for SPI. Therefore you must connect SDO1 on RC5 and SCK1 on...
  39. Replies
    53
    Views
    10,347

    Re: SPI GLCD Help needed

    Hard to tell without knowing what hardware you are using: PIC? LCD?
  40. Replies
    8
    Views
    815

    Re: Wireless alarm devices Home ...?

    Good idea!
  41. Replies
    8
    Views
    815

    Re: Wireless alarm devices Home ...?

    There are many places where you can buy 434MHz or 315MHz modules (search online). They are usually simplex ASK transmitter or receiver modules (not duplex transceivers). You can use them with the PIC...
  42. Replies
    8
    Views
    815

    Re: Wireless alarm devices Home ...?

    It is hard to tell as it depends on materials as the 2.4GHz is more susceptible to multipath fading. If you need the distance, maybe you should go with 433.92MHz which is more common in alarm systems.
  43. Replies
    8
    Views
    815

    Re: Wireless alarm devices Home ...?

    With the nRF24L01+ if you can limit to 6 devices, you can use the multi-pipe configuration which is a very simple way to manage a "star" network of 6 nodes. As to power source, 2.2V -3.3 V is good....
  44. Re: PIC18F K40 family of microcontrollers is now available

    Thank you you Les for the quick reponse
  45. Re: PIC18F K40 family of microcontrollers is now available

    I meant the continuous.
  46. Re: PIC18F K40 family of microcontrollers is now available

    Exactly. Also the triggering and auto sampling are great features
  47. Re: PIC18F K40 family of microcontrollers is now available

    Yes. I have signal processing (mostly audio and ultrasonic) applications that can benefit from the new ADCC
  48. Re: PIC18F K40 family of microcontrollers is now available

    Any plans for supporting 18FxxK40?
  49. Replies
    60
    Views
    3,739

    Re: Advice on receiving data string

    not necessarily. The sync with start and end byte is needed for decoding but the USART should receive bytes of data regardless. In my code, if you do not get a timeout, RC1IF was set and there should...
  50. Replies
    60
    Views
    3,739

    Re: Advice on receiving data string

    sorry I couldn't help you. I would still recommend going step by step: 1. make sure timer works and you have no timeout. 2. If no timeout, then something was received and you should be able to read...
  51. Replies
    60
    Views
    3,739

    Re: Advice on receiving data string

    Also, do a little test to make sure the osc and timer are working as expected. Run this code, RC.0 should toggle every 300mS:


    main:
    TMR0ON = 1
    While 1 = 1
    Timer0REG = 46786 ...
  52. Replies
    60
    Views
    3,739

    Re: Advice on receiving data string

    Try isolating the cause for error.
    Are you having timeout errors?
    If you are not getting a timeout, the USART flag was set so something was received.
    The framing errors may not be as critical. Try...
  53. Replies
    60
    Views
    3,739

    Re: Advice on receiving data string

    True! This is why in the I used the USART directly with an error handler that allows me to detect error flags (see code posted earlier).
  54. Replies
    60
    Views
    3,739

    Re: Advice on receiving data string

    Good catch. I know nothing about S.BUS but looked it up https://developer.mbed.org/users/Digixx/notebook/futaba-s-bus-controlled-by-mbed/
    and it says: "The highest bit is send first" and also...
  55. Replies
    60
    Views
    3,739

    Re: Advice on receiving data string

    Josef,
    Modified some existing code using the USART directly. The actions for errors are not defined as I don't know what you want to do, but you could use LED's, LCD etc to indicate which errors...
  56. Replies
    60
    Views
    3,739

    Re: Advice on receiving data string

    I know that you need it but you were not getting it with the bit banging and something was working.
    When you receive the 9th bit you always need to read it first by reading RCSTAx and only then read...
  57. Replies
    60
    Views
    3,739

    Re: Advice on receiving data string

    Just noticed the same old problem with showing bits % on the post. should read:

    TXSTA1 = 0x04 ' %00000100 - disable transmit, BRGH = 1
    RCSTA1 = 0x90 ' %10010000 - Enable,8bit reception, cont...
  58. Replies
    60
    Views
    3,739

    Re: Advice on receiving data string

    Joseph,
    Since RSIn is working for you and you want to use the UART, you should try setting the UART in a compatible way. Once it works, you can look into interrupts and other goodies available in...
  59. Replies
    60
    Views
    3,739

    Re: Advice on receiving data string

    Joseph, I thought you were trying to receive S.BUS so I'm surprised Rsin works. The manual says:"Overview Receive one or more bytes from a predetermined pin at a predetermined baud rate in standard...
  60. Thread: NCO to forum

    by barak
    Replies
    9
    Views
    2,711

    Re: NCO to forum

    An example can be made from code that was used in connection with the thread in http://www.protonbasic.co.uk/showthread.php/75632-Phase-Locked-Loops?p=503884&viewfull=1#post503884
    It uses NCO and...
  61. Replies
    10
    Views
    845

    Re: 3V alphanumeric LCD

    This one is under $2 with 44780 controller 3.3V...
  62. Replies
    10
    Views
    845

    Re: 3V alphanumeric LCD

    They sell clones for a lot less. I think made in Poland. Search by the controller model.
  63. Replies
    10
    Views
    845

    Re: 3V alphanumeric LCD

    Check the wiki at http://www.protonbasic.co.uk/content.php/2152-SPI-LCD-using-Proton-s-Print-command
    This one needs less pins (SPI) and works from 3V
  64. Replies
    33
    Views
    3,063

    Re: Accelerometer erroneous results "Float"

    Sorry, no time to rewrite but added something at the end and also directed to this thread.
  65. Replies
    33
    Views
    3,063

    Re: Accelerometer erroneous results "Float"

    Does anyone knows replace a file on the wiki?
  66. Replies
    33
    Views
    3,063

    Re: Accelerometer erroneous results "Float"

    I just tested Less's modified code - I can confirm it works and fixes the float issue.
  67. Replies
    33
    Views
    3,063

    Re: Accelerometer erroneous results "Float"

    Fantastic! I think Less just solved a problem that plagued this code from day one. I'll test it soon.
  68. Replies
    3
    Views
    765

    Re: Hardware SPI - LSB first

    Here is what I use. I got the assembler code from Less (http://www.protonbasic.co.uk/showthread.php/66420-Bit-reversal-LSB-gt-MSB-MSB-gt-LSB). Tested against my code and it was about twice as fast so...
  69. Re: Super low power options, need to use rechargable coin cell for project

    Yes, much faster but unfortunetly I can't reveal the trick
  70. Re: Super low power options, need to use rechargable coin cell for project

    Functionally as well as by footprint and cost, it was similar to a single cell PCM like: http://datasheet.sii-ic.com/en/battery_protection/S8211D_E.pdf
    Unlike the dedicated IC's, each having a...
  71. Re: Super low power options, need to use rechargable coin cell for project

    Interestingly my PIC10LF320 project was somewhat related. I was using the PIC10LF320 to implement a smart, PCM (protection circuit module) for a very small LiFePO4 battery. I think that battery only...
  72. Replies
    4
    Views
    1,125

    Re: 16f887+nrf024L sound transfer

    NRF24Z1 has a separate 50kbs control data channel and several I/O's on the IC that can be controlled by this channel. Read the datasheet.
  73. Replies
    4
    Views
    1,125

    Re: 16f887+nrf024L sound transfer

    Code example in http://www.protonbasic.co.uk/content.php/4423-NRF24L01P-radio-transceiver-Demo but for NRF024L01 your controller will need to work hard buffering data so the audio is streamed in real...
  74. Re: Transferring Individual bit array into a word variable

    If his "bit array" is already loaded to a word, why make it so complicated? Just do WordVariable = P (P being a word).
    I think he has a byte array that only contains 1's or 0's which he now wants...
  75. Replies
    9
    Views
    871

    Re: Problem sending HEX

    When he adds the modifier he is not sending the value he is sending the ASCII value representing the characters. for example $01 will send the values 0x30, 0x31. Since he can't add the modifier to a...
  76. Replies
    22
    Views
    2,037

    Re: Phase Locked Loops

    David, sorry to hijack the thread again again but you reminded me the days we knew how to build entire devices with 4000 series. Just a few days ago I was cleaning up and found a board circa mid...
  77. Replies
    22
    Views
    2,037

    Re: Phase Locked Loops

    David, you are right. PLL it is a better solution and IC such as 4046 are inexpensive but it was interesting to "explore" the potential of a cheap micro to do it all using "programmable hardware"...
  78. Replies
    22
    Views
    2,037

    Re: Phase Locked Loops

    David,
    Regarding the crystal accuracy, the NCO can compensate for some of that. The resolution with a 12MHz crystal is 5.7Hz. Actually, in my test, I has use one value less than the nominal...
  79. Replies
    22
    Views
    2,037

    Re: Phase Locked Loops

    Guys,
    This topic got me intrigued as to the potential of NCO and CLC so I decided to spend a few hours and whip something to test the concept on a 16F1509.
    NCO Reference signal: XTAL = 12MHz 30PPM,...
  80. Replies
    22
    Views
    2,037

    Re: Phase Locked Loops

    Hi David, I don't think I explained it well enough: It works exactly as a phase detector. Even without controlling a VCO it will still detects phase offsets. The signal from BBC first goes to a...
  81. Replies
    22
    Views
    2,037

    Re: Phase Locked Loops

    The advantage of using the NCO and CLC is that it is all done in hardware no cycle needed.
  82. Replies
    22
    Views
    2,037

    Re: Phase Locked Loops

    The XOR will not work as a mixer it will work as a phase detector: as long as there is no modulation, the signal is steady and the two inputs (reference and signal) have a steady phase offset, the...
  83. Replies
    22
    Views
    2,037

    Re: Phase Locked Loops

    I think you can do the entire thing including a "phase comparator" on a PIC16F1509: Using an 8MHz or 16MHz Crystal, the NCO can generate the reference at 197.998 KHz (2 Hz error). This signal can be...
  84. Replies
    29
    Views
    3,644

    Re: Pulsein minimum value

    If you are still using the 16F1827, consider using Timer1 Gate (maybe in single pulse mode(. I recently had to measure pulses with a PIC16F that does not have a CCP module and the T1G worked great....
  85. Replies
    1
    Views
    931

    Re: LCD EA DOG 128 PIC18F44K22 Not displaying

    18F44K22 has only 768 RAM, it is not enough to run the code I put on the WIKI http://www.protonbasic.co.uk/content.php/3679-Using-PDS-with-SPI-GLCD-based-on-ST7565R-Controller
  86. Replies
    9
    Views
    2,078

    Re: Problems PIC18F26K22 with LCD ST7565R SPI

    In file ST7565_DEF.inc change the value of VOLUME_REG
    see http://www.lcd-module.de/eng/pdf/zubehoer/st7565r.pdf pages 45-46
  87. Replies
    18
    Views
    3,261

    Re: Perennial USART RF issue

    Polarity:
    To work with RF modules, the signal to the RF transmitter must be inverted - meaning idle low (1=high, 0=low).
    It is possible to set the transmitter side on both PIC's 16F and 18F by...
  88. Replies
    18
    Views
    3,261

    Re: Perennial USART RF issue

    I don't think 16F616 has a hardware UART. If I recall, none of the 16F's can change the polarity of the RX. I always use 18F with the radio modules.
  89. Replies
    18
    Views
    3,261

    Re: Perennial USART RF issue

    I have been using the EUSART with very simple radio modules connected directly to the PIC for years. It is way more reliable than bit banging serial. Never a problem with the “noise”. The important...
  90. Replies
    7
    Views
    1,379

    Re: Basic maths question

    If I understand your post correctly, it should be simple:
    The distance between sensors is known = 30mm
    You measure the time delay between sensors - call it T1
    You then measure the time it takes...
  91. Thread: Analog reading

    by barak
    Replies
    21
    Views
    2,363

    Re: Analog reading

    MCP1703 will be accurate enough for the ADC. If your source is 4V you can use 3.3V regulation and get a slightly better full scale range.
  92. Thread: Analog reading

    by barak
    Replies
    21
    Views
    2,363

    Re: Analog reading

    The PIC may tolerate 5V but because VDD is only 3V you will get the maximum value from a 3V input to the ADC. I would use a 1:4 voltage divider to bring the max. 12V to 3V. A divider made of 10K in...
  93. Replies
    32
    Views
    5,841

    Re: Efficient RF protocol

    Considering your application, you made the right choice for the frequency and power. I wouldn't even consider anything with higher frequency for the topography and distance you need.
    Would you mind...
  94. Replies
    54
    Views
    9,590

    Re: Buffered_Hserin and CDC USB

    This is how I use the function from the post below on the TX side:


    Array.Clear(TXArray, 0, TXArray.Length)
    Dim j As Integer = 0
    For i As Integer =...
  95. Replies
    54
    Views
    9,590

    Re: Buffered_Hserin and CDC USB

    I had a problem with the post continue above...
  96. Replies
    54
    Views
    9,590

    Re: Buffered_Hserin and CDC USB

    The one char issue is not an issue of speed. I had this problem while ago but can't remember what it was. My VB2008/2012 application does not have this problem.
    With Serial and USB, On the TX side...
  97. Replies
    32
    Views
    5,841

    Re: Efficient RF protocol

    a directional antenna is good for stationary units with a line of sight but the LNA will increase the range significantly. The NRF24L01+ chip is capable of powering down the LNA component. So, if the...
  98. Replies
    32
    Views
    5,841

    Re: Efficient RF protocol

    It is simple: The module with LNA is more sensitive in PRX mode allowing it to receive the weaker signal of the standard module and also transmits more power in PTX mode so it can reach the less...
  99. Replies
    32
    Views
    5,841

    Re: Efficient RF protocol

    The LNA modules advertise 1000 meters but I don't think it is realistic unless you have a line of sight. The 2.4 GHz is very directional and does not go well through walls. The LNA modules I found...
  100. Replies
    32
    Views
    5,841

    Re: Efficient RF protocol

    What are you using for the radio?
  101. Thread: Pic to Pic SPI

    by barak
    Replies
    13
    Views
    2,549

    Re: Pic to Pic SPI

    John,
    Glad I could help. We have to keep the hierarchy: "genius" should be reserved for Les and such.
    I just have some experience (i.e., old) so I already made this mistake trying to use BF...
  102. Thread: Pic to Pic SPI

    by barak
    Replies
    13
    Views
    2,549

    Re: Pic to Pic SPI

    I think the problem is in your slave loop. Try replacing:

    'Your original Slave SPI LOOP:
    LOOP:
    If SSPIF = 1 Then
    SSPIF = 0
    For i = 0 To 3 ' you may be reading the buffer before you have...
  103. Replies
    3
    Views
    1,602

    Re: 18F26K22 vs 18F46K22

    They are the same just more pins on the 46K22. So it should work as long as you don't address missing pins.
  104. Replies
    16
    Views
    3,937

    [SOLVED !] Re: Need help decoding IR signal...

    Consider using Capture Mode (see CCP in the datasheet)
  105. Replies
    14
    Views
    2,724

    Re: Speed up rate of taking ADC values

    Instead of delays try using special event trigger, this will allow you to do some calculations between samples such as a peak detector which may come handy if you are planing on coulomb counting.
  106. Replies
    14
    Views
    2,724

    Re: Speed up rate of taking ADC values

    Hi can do average or peak detector digitally. He just needs to slow down the sampling. As I read the code, he takes 250 samples without any delay (it probably takes less than 1mS to complete all of...
  107. Replies
    14
    Views
    2,724

    Re: Speed up rate of taking ADC values

    You are sampling too fast for your wave form.You need some delay in the sampling loop or use Special event trigger...
  108. Replies
    11
    Views
    3,315

    Re: Putting a 18F14K50 to sleep

    I think you should read port A before going to sleep to prevent mismatch condition on the IOC pin
  109. Replies
    11
    Views
    3,315

    Re: Putting a 18F14K50 to sleep

    I thought you wanted the flusher to blink while sleep.
  110. Replies
    11
    Views
    3,315

    Re: Putting a 18F14K50 to sleep

    Why not use the watchdog to wake up?
  111. Replies
    2
    Views
    1,463

    Re: Powering peripherals from PIC gpio

    I found that although I/o are specified to deliver 25mA you can't really drive that much from one I/o. However, you can drive more current by using several I/Os in parallel.
  112. Replies
    11
    Views
    1,938

    Re: RF attenuation methods?

    Bread board is not a good idea with 434MHz. The impedance does't really matter, you just want to make it inefficient. I'd go with Joan's idea, start cutting the antenna short 1/8" at a time until you...
  113. Replies
    11
    Views
    1,938

    Re: RF attenuation methods?

    Yes. The impedance of this antenna is unknown so you'll have to to some experimenting. Do you have a Spectrum Analyzer?
  114. Replies
    11
    Views
    1,938

    Re: RF attenuation methods?

    Try cutting the antenna and add a "T Attenuator"
  115. Thread: Use of Symbol

    by barak
    Replies
    6
    Views
    2,048

    Re: Use of Symbol

    Will something like the code below work so changes in alias reflect in the declared variable? The purpose of creating alias locally is to have names that mean something to the local functionality so...
  116. Replies
    14
    Views
    3,641

    Re: Calculating battery life

    It works for a few micro-volts but at some point, adding high resistance in the supply path affects the circuit. There is no substitute for good measurement equipment that has very low noise amps...
  117. Replies
    14
    Views
    3,641

    Re: Calculating battery life

    Fancy, you can get 10nA resolution.
    Let me know when you start the new thread and I'll throw in my 2 cents.
  118. Replies
    14
    Views
    3,641

    Re: Calculating battery life

    what are you using to measure current?
  119. Replies
    14
    Views
    3,641

    Re: Calculating battery life

    I grantee the MC current drain specs are are met and sometimes better. I have several products that go down to 40 - 50 Nano Amp @ 3V, using PICs with XLP such as 18LF13K22. The lowest I ever got was...
  120. Re: Serial data transmit through a RF 433MHz to a MCU16F877A From a PC

    Is the signal from the PC idle low? If not the TX will not work properly.
    Are you sending a preamble? If not the TX may not be ready and the data slicer on the RX will not be biased.
    Manchester is...
  121. Re: Serial data transmit through a RF 433MHz to a MCU16F877A From a PC

    On the PC side you have to consider: (1) level translation of the RS232 from the PC to the voltage range you use on the TX. (2) invert the signals so that idle is low. I think MAX232 should take care...
  122. Re: Serial data transmit through a RF 433MHz to a MCU16F877A From a PC

    Not sure I'm the best person to help you as I hardly ever use the compiler's serial commands as I almost always use the UART module on the MCU. I'm sure there are meany examples for serial...
  123. Replies
    9
    Views
    3,259

    [SOLVED !] Re: how to break a loop from rs232

    you description is not clear. Also, I never used SerIn/SerOut I always use the UART module or in case i don't have one I use RsIn/RsOut.
    If I understand correctly, you want to go back to...
  124. Re: Serial data transmit through a RF 433MHz to a MCU16F877A From a PC

    Questions: which RF TX/Rx (modules) you are using (datasheet)?
    Can this RF system can handle 9600 bps?
    Are you using the UART module (hardware) or bit banging?
    Are you using a crystal?
    Did...
  125. Replies
    9
    Views
    3,259

    [SOLVED !] Re: how to break a loop from rs232

    I strongly advise you use the USART module. This will give you more options including interrupts if needed. I'll post an example for you over the weekend
  126. Replies
    9
    Views
    3,259

    [SOLVED !] Re: how to break a loop from rs232

    Post a functional description - Describe step by step exactly what you want to do.
    Also what PIC you are using.
  127. Replies
    28
    Views
    5,126

    Re: delayms precision

    Why would you want 1MHz? This will dictate a very slow and/or inaccurate baud rate for the RS232.
    If you are sending data to a PC you want a relatively high data rate like 19,200 bps and should use...
  128. Replies
    28
    Views
    5,126

    Re: delayms precision

    did you try the file i attached?
  129. Replies
    28
    Views
    5,126

    Re: delayms precision

    Bitwise Complement '~'. Reverses the bits in a variable.
  130. Replies
    28
    Views
    5,126

    Re: delayms precision

    Did you actually read what I posted about the xtal?

    BTW, the code Sample I posted for you did not run from a crystal it ran from int osc.

    I posted the correct value for T1CON but unfortunately...
  131. Thread: Using shift left

    by barak
    Replies
    6
    Views
    1,537

    Re: Using shift left

    The datasheet says in 3.2: UT = temperature data (16 Bit)
    UT = MSB << 8 + LSB is just for combining two bytes into a word
    So George's code is correct
  132. Replies
    28
    Views
    5,126

    Re: delayms precision

    I use timers in a loop all the time. I use interrupts only when absolutely necessary or when I'm counting timer laps. For example, say I'm waiting for an ACK response from some piece of hardware but...
  133. Replies
    28
    Views
    5,126

    Re: delayms precision

    I only posted an example so you can actually try it. Examples are meant to be simple so you can focus on the issue at hand. Blinking a LED is all you need to learn timers.

    The code I posted...
  134. Replies
    28
    Views
    5,126

    Re: delayms precision

    You should be able to calculate using the information provided earlier about timer calculation.
    With the 16F88 you will need to run at Fosc=2MHz in order to do a 1Sec timer period.
    Here is basic...
  135. Replies
    28
    Views
    5,126

    Re: delayms precision

    No doubts needed. This is simple stuff that works. You just need to do it once and you will get it. Start with something simple like blinking a LED on a timer.
    If you post what PIC you are using...
  136. Thread: Service Timer

    by barak
    Replies
    15
    Views
    3,395

    Re: Service Timer

    If you don't have the HLVDIN pin available for external input, you can still use HLVD to determine that VDD dropped. Because your VDD = 5V, you could set HLVDCON = %00001110 so it trips when VDD goes...
  137. Thread: Service Timer

    by barak
    Replies
    15
    Views
    3,395

    Re: Service Timer

    Here is a n example from working code on 18F45K20

    HLVDCON = 001111 ' HLVDL = 1111 for external pin 1.2V threshold - need a divider from the unregulated supply
    Symbol HLVDEN ...
  138. Thread: Service Timer

    by barak
    Replies
    15
    Views
    3,395

    Re: Service Timer

    Perfect. This is exactly what I do. assuming your regulator is LDO you probably don't have more than 2V drop off so you have a huge range to detects a sudden power down. If your PIC has HLVD it is...
  139. Thread: Service Timer

    by barak
    Replies
    15
    Views
    3,395

    Re: Service Timer

    How are you powering the PIC? If the supply to the PIC is regulated, the solution I described works better if you "measure" the voltage before the regulator (through a divider if too high). This will...
  140. Replies
    28
    Views
    5,126

    Re: delayms precision

    See my example below.
    Depending on the clock speed (Fosc) a timer resolution (AKA "tick") can be very high. For example at Fosc=64MHz, the shortest tick can be 62.5 nano seconds.
    The timer accuracy...
  141. Replies
    28
    Views
    5,126

    Re: delayms precision

    Since there are no event driven activities in your code, the loop should always have the same duration. You can measure it with a scope.
    If for some reason you would have varying activity in the...
  142. Re: Swap digital 12s data lines on sensing audio input

    You can use a Quad SPDT multiplexer. See http://www.ti.com/product/ts5v330
  143. Thread: Service Timer

    by barak
    Replies
    15
    Views
    3,395

    Re: Service Timer

    This is what I do save data to EEPROM only in case of a sudden power down:
    To buy some time, I use a large cap on the supply line to the PIC, say 220uF . A comparator (with FVR) or HLVD detects and...
  144. Replies
    53
    Views
    10,347

    Re: SPI GLCD Help needed

    Updated files are attached to the wiki at http://www.protonbasic.co.uk/content.php/3679-Using-PDS-with-SPI-GLCD-based-on-ST7565R-Controller
    I tested it with a recent version of the compiler and it...
  145. Replies
    3
    Views
    1,427

    Re: How to upload files for a WIKI article?

    Thanks Norm. That did it. Way more simple than uploading to User Files.
    BTW, maybe the web is slow because the electrons are frozen so they are slower? It’s 7°F here in Minnetonka....
  146. Replies
    3
    Views
    1,427

    How to upload files for a WIKI article?

    I'm trying to upload updated files for the wiki http://www.protonbasic.co.uk/content.php/3679-Using-PDS-with-SPI-GLCD-based-on-ST7565R-Controller

    On the WIKI I read: "To Upload a file, click on...
  147. Replies
    53
    Views
    10,347

    Re: SPI GLCD Help needed

    It is not exactly a bug. It was a while ago so I don't recall what it was. I have a newer version that has some new features and also draws circles but I can'y figure out how to upload it to the User...
  148. Replies
    15
    Views
    3,325

    Re: HPWM to generate FSK

    At the low frequencies you mentioned you can get a nice sine with DDS.
    But I don't understand why and how you do AM modulation with FSK signals?
  149. Replies
    18
    Views
    2,992

    Re: IRDA Programmable Constant Current source

    I tested on a circuit I had using a PIC with comparator and PWM.
    Rick you were right, it does not work for fast switching load: although the level at the base of the PNP is stable, as the switching...
  150. Replies
    18
    Views
    2,992

    Re: IRDA Programmable Constant Current source

    I think that if the feedback response is much slower than the signal, the transistor will be is an almost steady condition and will limit the max. available current. You will need to make some...
  151. Replies
    18
    Views
    2,992

    Re: IRDA Programmable Constant Current source

    Rick,
    In theory you are right. However, becuase it is a compartor not an Op-Amp, the LPF slows the reposne. You could also put a cap on the sense signal so if the data rate is very high you may have...
  152. Replies
    18
    Views
    2,992

    Re: IRDA Programmable Constant Current source

    I never used MCP2122 so I'm not sure. However, the circuit I posted is High side so there should be no issues with ground potentials. You can try to connect to the I/O shown in the drawing but that...
  153. Replies
    18
    Views
    2,992

    Re: IRDA Programmable Constant Current source

    John, as shown this solution requires the same supply voltage (preferably regulated) to both PIC and Load. If not the same, use the PWM to switch another transistor on the supply to the load so that...
  154. Replies
    18
    Views
    2,992

    Re: IRDA Programmable Constant Current source

    A few years back I developed a control system that included a programmable high side constant current source on a PIC16F1823. It had to be small and low cost so I used a comparator on the PIC instead...
  155. Re: Barak's Wiki and code on nRF24L01+. ACK with payload fail.

    Added to Wiki an example for Ack with payload in which the PRX attaches a payload to the Acknowledgement. The example is based on the original demo but you need to add one mode LED (LED2) to the PTX....
  156. Re: Barak's Wiki and code on nRF24L01+. ACK with payload fail.

    Good idea. I just need some time to verify that it works and maybe change so it does not need an LCD (just blink a LED or something and then I can update.
  157. Re: Barak's Wiki and code on nRF24L01+. ACK with payload fail.

    George,
    I'm happy to help.
    You could load continously but you should clear (FLUSH) the buffer before you load data. Unless you have the IRQ on an interrupt, it is a better practice to have the PRX...
  158. Re: Barak's Wiki and code on nRF24L01+. ACK with payload fail.

    Does your code works with out ACK with payload? I mean does it work with a simple transmit/receive?

    Not really getting into the details of your code I noticed a few things worth mentioning:
    PRX...
  159. Replies
    4
    Views
    15,721

    Re: No support for PIC16F527?

    Thanks for the link. This make sense. Why invest time in an odd off shoot. I was thinking of using it as a smart piece of hardware with the op amps, compartors, etc. I'll just write the code in C.
  160. Re: SPI: correct setting for SMP, CKE and CKP with nRF24L01+

    Yes, I do ACK with payload all the time, works great. I also have an implementation of Muliciever with 6 "pipes". The NRF24L01P is a great tranciever very flexible and relaible. The documetation is...
  161. Re: SPI: correct setting for SMP, CKE and CKP with nRF24L01+

    George,
    Quote from the NRF24L01P datasheet page 50 section 8.3.1 SPI commands: "The STATUS register is serially shifted out on the MISO pin simultaneously to the SPI command word shifting to the...
  162. Re: SPI: correct setting for SMP, CKE and CKP with nRF24L01+

    Since data is exchanged bit for bit, I don't think SHIN/SHOUT can work with NRF as you will not be able to read the status byte. You need to use SPI or bit banging similar to the ASM example poster...
  163. Re: SPI: correct setting for SMP, CKE and CKP with nRF24L01+

    Feel free to publish
  164. Replies
    4
    Views
    15,721

    No support for PIC16F527?

    PIC16F527 does not appear to be supported by the compiler. Is there a reason for not including it in the supported devices?
    It is the cheapest PIC for this size. At $0.58 With two op-amps it is...
  165. Thread: nRF24L01

    by barak
    Replies
    51
    Views
    45,891

    [SOLVED !] Re: nRF24L01

    Check the Wiki: http://www.protonbasic.co.uk/content.php/4423-NRF24L01P-radio-transceiver-Demo
  166. Thread: nRF24L01

    by barak
    Replies
    51
    Views
    45,891

    [SOLVED !] Re: nRF24L01

    I created a WIKI "NRF24L01P radio transceiver Demo". Just need a moderator to publish. It comes with code that should be easy to get started with. The code basically toggles a LED on the PRX when you...
  167. Thread: nRF24L01

    by barak
    Replies
    51
    Views
    45,891

    [SOLVED !] Re: nRF24L01

    I have some complicated implementations with the NRF24L01P and they are great, dependable transceivers.
    I realize the code I posted "NRF24L01_18F13K22_RX.bas", is a bit too complicated for someone...
  168. Replies
    7
    Views
    4,141

    Re: Can't load 16 bit value in Timer 0

    Make your life easy, alias the timer register as a word = TMR0L & TMR0H. Example:

    Dim Timer0REG As TMR0L.Word

    Timer0REG = 0x1000
  169. Replies
    14
    Views
    8,311

    Re: Android to PIC18F4550 via usb

    Use Bluetooth to serial.
  170. Replies
    10
    Views
    6,529

    Re: Multiple button on a single ADC port.

    You can create different values with combinations of the same resistor: 2 series 10K = 20K, 10K||10K = 5K,etc
  171. Replies
    10
    Views
    6,529

    Re: Multiple button on a single ADC port.

    If you want to press multiple switches simultaneously you need to connect parallel resistors and preferably select a "binary" ratio (ratio of 2) between resistors.
    Attached is an example of 4...
  172. Replies
    9
    Views
    7,438

    Re: RS232 Serial Checksum Needed?

    See the code I posted below. I've used it for years on a wireless link and it works very well given the simplicity.
  173. Replies
    8
    Views
    3,710

    Re: Pic18F25K22 - PortB enabling Pull up

    init()
    {
    // i did not know we can compile C in PDS
    // this is a breakthrough in compiler technology
    // the next step should be C++ and java
    // one compiler does it all
    }


    Just kidding...
  174. Re: Initialising an Electronic Assembly EA DOGM Character LCD

    Yes you are right line 3 starts at 33. Is this from PIC24 ?
  175. Re: Initialising an Electronic Assembly EA DOGM Character LCD

    Can you check what happens if you print only to line 1 but change the character number. For example:
    Print At 1, 1 'line 1, pos 1
    Print At 1,17 'line 2, pos 1
    Print At 1,32 'line 3, pos 1
  176. Replies
    9
    Views
    7,438

    Re: RS232 Serial Checksum Needed?

    For wired systems usually a simple checksum will do it. Try:

    ' on TX - prepare the checksum
    Check_Sum:
    ...
  177. Replies
    22
    Views
    8,809

    Re: Using a DOGM Dispaly in SPI Mode

    It only shows that his brain is running ahead of his fingers
  178. Replies
    22
    Views
    8,809

    Re: Using a DOGM Dispaly in SPI Mode

    SSBUF does not come from the code it is the buffer for the SPI data. My example was probably from 18F13K22 with only 1 SPI. In the case of 18F4XK22 it will be SSPxBUF one for each SPI. I think it is...
  179. Replies
    22
    Views
    8,809

    Re: Using a DOGM Display in SPI Mode

    I haven't had the time to start with the 16bit PICs but you can try and port the code from my examples:
    For the alphanumeric:...
  180. Re: How to add change CDC Descriptor serial number string

    You are right, 13th item does no sound very lucky.
    I never used HID and don't have much experience with USB in general. However, with PDS offering USB solution for dummies, I developed a USB RFID...
  181. Re: How to add change CDC Descriptor serial number string

    Yes, it works great. I tried on 7 different USB ports and keeps the COM Port it got the first time on all of them
  182. Re: How to add change CDC Descriptor serial number string

    That is exactly what I wanted. You almost nailed it. For this to work, I also had to change the String pointer table to add a pointer to the new string.
    So that it is clear for anyone in the future...
  183. Re: How to add change CDC Descriptor serial number string

    George, I'm assuming you would change the serial number index here:

    Desc_DeviceDescriptor: Dt (Desc_EndDeviceDescriptor - Desc_DeviceDescriptor) / 2 ' Size of this descriptor (in bytes)
    Dt...
  184. Re: How to add change CDC Descriptor serial number string

    Yes, sure please PM
  185. Re: How to add change CDC Descriptor serial number string

    Thanks, I aware of Axelson but I'm pressed for time and wanted a "direct answer" from someone who already added/changed the serial number in Proton's CDC Descriptor
  186. Re: How to add change CDC Descriptor serial number string

    Not on the fly. At this point, I don't care if they are all the same number. I just want to have serial number so I don't have to change com port numbers if I plug to another USB port on the PC. Once...
  187. How to add change CDC Descriptor serial number string

    Can some please explain how to add or change a serial number string in the CDC Descriptor file so that the device will have a serial number and retain the COM port number if moved to a different USB...
  188. Replies
    13
    Views
    2,644

    Re: Remote controller (RF) wheelchair

    The Datasheet is at https://www.nordicsemi.com/eng/Products/2.4GHz-RF/nRF24L01P
    If you can use the module in this configuration...
  189. Replies
    13
    Views
    2,644

    Re: Remote controller (RF) wheelchair

    I wouldn't consider a simplex radio like the 434MHz modules for a wheelchair and I don't think ZigBee is designed for these applications. I think you need a transceiver that can acknowledge receipt...
  190. [SOLVED !] Re: Divide 4 digit number into units for multiplexing.

    I'm not sure what you need. If you are only interested in getting digits out of a number, look at the DIG command in Proton manual or divide by the position and use the modulus operator to find the...
  191. Replies
    16
    Views
    2,974

    Re: Display 4-Line Interface

    I thought the KS0066 is compatible with HD44780. If it is then why not let Proton initialize it for you.
  192. Re: Proton 3.5.6.7 and Proton24 1.0.2.3 available for download

    be careful not to try too hard
  193. Re: Proton 3.5.6.7 and Proton24 1.0.2.3 available for download

    The full version of 24 is already out?! I just realized it is free to PDS license holders. I was expecting to pay for it. Fantastic!
    I'm so happy I decided to go with Proton a few years ago. It...
  194. Thread: Dtmf in

    by barak
    Replies
    50
    Views
    8,344

    Re: Dtmf in

    Thanks Les
  195. Thread: Dtmf in

    by barak
    Replies
    50
    Views
    8,344

    Re: Dtmf in

    Sorry I missed something. Where is the Log example? In this thread?
  196. Replies
    18
    Views
    6,585

    Re: USB does not output more than 39 bytes?

    I can guarantee the reception issue you encountered is a problem specific to the Serial com terminal not with PDS. I must be so slow that after each byte the loop is aborted. I spent so much time...
  197. Replies
    18
    Views
    6,585

    Re: USB does not output more than 39 bytes?

    Thanks Les. The USB works great otherwise and the little 18F14K50 is nice and cheap so it would be good to know what is going on.
    I want to be clear that I did: I never used the HID descriptor only...
  198. Replies
    18
    Views
    6,585

    Re: USB does not output more than 39 bytes?

    As far as I can see the descriptor says 64 bytes everywhere but maybe I'm missing something.

    I don't think that an echo is good way to verify the output as the device may not receive the input so...
  199. Replies
    18
    Views
    6,585

    Re: USB does not output more than 39 bytes?

    Appreciate the effort. What do you mean by "created a program using mePascal, flashed it to the same board "? Does it mean you did not use Proton?
    I know it is not the 18F14K50 device. If you say it...
  200. Thread: Dtmf in

    by barak
    Replies
    50
    Views
    8,344

    Re: Dtmf in

    John, You could "simultaneously" detect 1750 Hz and 200 Hz because the 200Hz will be very slow. you will have two compactor inputs with different LPF, you can sample at a fixed speed suitable for the...
Results 1 to 200 of 711
Page 1 of 4 1 2 3 4