Search Results - Proton BASIC community web site


Search:

Type: Posts; User: tumbleweed

Page 1 of 3 1 2 3

Search: Search took 0.02 seconds.

  1. Replies
    7
    Views
    229

    Re: SERIN/SEROUT how low can you go?

    George has a good suggestion.

    From what I can tell, SEROUT bottoms out at about 130, and it doesn't seem to really matter if it's running at 32MHz or slower.
    RSOUT works at 100 baud (no idea...
  2. Replies
    5
    Views
    148

    Re: Clean up old versions

    I uninstall all the previous versions and then reinstall the last one.
    That seems to make windows uninstaller happy (it removes all the previous instances).

    Note that if you have any other...
  3. Replies
    15
    Views
    286

    Re: Newbie to the forum

    Thanks, Rob. I see that now.

    I wasn't aware of that part, so it's good to know there's an option.
  4. Replies
    15
    Views
    286

    Re: Newbie to the forum

    Rob -

    When you say the 18F25K80 can work at elevated temperatures what are you referring to?
    AFAIK, it has the same temperature specs as pretty much all the other chips (125 degC max)
  5. Re: file missing from Proton 3.7.3.3 update??

    Thanks Les
  6. file missing from Proton 3.7.3.3 update??

    Is it just me or is the download file missing from the Proton 3.7.3.3 update post Les made yesterday?
  7. [SOLVED !] Re: MCP3421 problem with the diffrencial value when it Vin+ is more negative than Vin

    The data is in 2's complement format so you should make sure that all the upper bits reflect the setting of bit 17 (assuming you're doing an 18-bit conversion)

    How about something like this...
    ...
  8. Re: Question about Hbusin / Hbusout on PIC16F15313

    You could always go straight to the horses mouth (Microchip), pay 10x what Proton costs, and find out that their compiler/libraries don't fully support the chip you're using.

    Good luck getting...
  9. Replies
    10
    Views
    312

    Re: Need some help from a VB expert

    I think JohnB was asking about having to set RX/TX port pin directions for the PIC uart... nothing to do with the VB code per say.

    From what I recall the PPS Tool code generator doesn't set any...
  10. Replies
    19
    Views
    1,032

    Re: PPS for 8bit Microchip Micocontrollers

    I think I'd have to say no to that right now. I've modified the app for 8-bit devices, John.

    I've only glanced at it briefly but I think it would be a lot more work for the 16-bit devices.
  11. Replies
    19
    Views
    1,032

    Re: PPS for 8bit Microchip Micocontrollers

    They're GCB macros. They translate to:


    macro UNLOCKPPS
    dim IntState as bit
    IntState = GIE
    GIE = 0
    PPSLOCK = 0x55
    PPSLOCK = 0xAA
    PPSLOCKED = 0x00 'unlock PPS
  12. Replies
    12
    Views
    2,873

    Re: Anybody used the ADS1115 16bit A/D?

    It's standard 2's compliment representation, where max pos = 0x7FFF and max neg = 0x8000


    No.
    From the datasheet "This parameter expresses the full-scale range of the ADC scaling.
    No more...
  13. Replies
    7
    Views
    1,419

    Re: ICD2, ICD3 or QL200 dev board

    If you're using mplab IDE to build, the main 'Debugger' and 'Programmer' drop-downs menus control what mode is used (selecting one disables the other).

    If you want to program the device instead of...
  14. Re: dword to float changes, lost of accuracy

    not trying to nit-pick, but


    32-bits gets you roughly 6-7 decimal digits of precision. Doesn't matter (much) if the digits are before or after the decimal point, it's 6-7 digits total.
  15. Replies
    7
    Views
    1,419

    Re: ICD2, ICD3 or QL200 dev board

    The mplabx IPE supports the ICD3, but the ICD2 is too old.

    The ICD2 requires MPLAB 8. I don't remember if MPLAB had command-line drivers for the ICD2 or not.
  16. Replies
    7
    Views
    1,419

    Re: ICD2, ICD3 or QL200 dev board

    As long as you're using a device that is supported by the old MPLAB 8.92 then you can compile, program, and debug using the ICD3 in the MPLAB IDE. There are MPLAB drivers in the folder "Using Proton+...
  17. Replies
    47
    Views
    1,081

    Re: PIC 18F1330 HPWM problem

    I see what you mean. They don't show a description of the TMR2/4/6 count registers either, but they are shown in the figure 22-1 block diagram, table 22-1, and discussed in the text. I guess they...
  18. Replies
    5
    Views
    360

    Re: Proton USB boot loader 2019

    When you say "one of the USB pins" which pins are you referring to?

    Keep in mind-
    1) you are not allowed to source any voltage on the USB D+/D- pins, especially if the host has not asserted VBUS....
  19. Replies
    47
    Views
    1,081

    Re: PIC 18F1330 HPWM problem

    What registers would those be, John?

    From what I see the 16F1827 has 4 PWM peripherals each of which can use one of the even numbered timers (TMR2/4/6). That means you should be able to setup at...
  20. Replies
    47
    Views
    1,081

    Re: PIC 18F1330 HPWM problem

    I think the only PIC18F in that package is pretty much what you have... the 18F1320/1330.
  21. Replies
    10
    Views
    772

    Re: Time to wake up! (SLEEP issue)

    The order of setting CM1CON1 needs to change... the edge setting is getting over-written


    CM1CON1 = 110000 ' Allocate FVR to COMP1 positive input
    CM1CON1.6 = 1 ' C1INTP negative going edge

    ...
  22. Replies
    10
    Views
    772

    Re: Time to wake up! (SLEEP issue)

    There are a few things missing, such as selecting either rising or falling edge for the comparator intr

    Here are some suggestions...

    ...
  23. Replies
    11
    Views
    184

    Re: Serin baud rate / clock dependency?

    It wouldn't be too difficult to bit-bang a uart faster than 115K. Probably the most important thing with using a software uart is to remember it's a software uart.

    That means anything that can...
  24. Replies
    5
    Views
    84

    Re: PIC 16F18344 PORTA.5 issue

    To the best of my knowledge there's not much that can stop a port pin that's configured for output mode (TRISx=0) from driving the IO pin except a CONFIG setting or the ODCONx open-drain register....
  25. Re: HAVING ISSUE WITH PROC USAGE project is high speed serial backpac

    I don't think that's the case anymore... the compiler rearranges the code and puts the procs at the end.

    Anyway, here's a simple version of that code that shows the issue. When you call DispStr()...
  26. Replies
    9
    Views
    80

    Re: Pic to pic connections

    If you're going to do parallel data having an extra "data valid" line is probably a good idea.

    Otherwise you can run into issues as you update the outputs since it'll take at least two writes to...
  27. Replies
    15
    Views
    1,955

    Re: Req. I2C Scanner

    That one looks like it just might work using PP4.0 or STATUS.0 to check the ACK bit, so try:


    ' bit-banged
    Dim PP4 As Byte System
    ndevices = 0
    For addr = 0 To 254 Step 2
    BStart ' send...
  28. Replies
    15
    Views
    1,955

    Re: Req. I2C Scanner

    Looks like you're right, George.
    I took a look at the asm and maybe I'm missing something but it looks like it's anding the result and losing the flag.

    Try this and see if it works any better:
    ...
  29. Replies
    15
    Views
    1,955

    Re: Req. I2C Scanner

    This is the way I would do it...


    nDevices = 0
    For address = 0 To 254 Step 2
    HbStart ' send START
    HBusOut address ' send ADDR byte w/RW=0 (write)
    If PP4.0 = 0 Then ' check ACK...
  30. Replies
    6
    Views
    134

    Re: New CAN Library

    All of those devices are very old.

    How about the K80 and K83 families?
  31. Replies
    9
    Views
    104

    Re: Is XTAL available at compile time

    There are different ways to do this, and it depends on your desired result.

    If you do as you mentioned, assigning 'xtal' to a byte value like so:


    Dim b As Byte

    Dim XTAL_Speed As Byte...
  32. Replies
    9
    Views
    72

    Re: CWRITE and 18F25K50

    64 bytes is 0x40, so the block that contains 0x0C20 is:
    (0x0C20/0x40)*0x40 = 0xC00 (to 0xC3F)

    The block after that is 0xC40 - 0xC7F
  33. Replies
    9
    Views
    72

    Re: CWRITE and 18F25K50

    No, not in a single operation.

    The 64-byte block must be aligned to a write-block page boundary. You can't cross pages in a single write.
    Also, to (re)write a block it must first be erased, which...
  34. Replies
    24
    Views
    170

    Re: The use of USB with the 18F2550

    USB_BUS_SENSE should be connected to the USB VBUS 5V power.

    It's used to sense if you're connected to a USB host when you're powered externally (self-powered).
    If you're self-powered you really...
  35. Replies
    24
    Views
    170

    Re: The use of USB with the 18F2550

    There is an internal 3V3 regulator that powers the usb transceiver.
    You need to set VREGEN = 1 and put a cap on the VUSB pin (they recommend 220nF).
  36. Replies
    24
    Views
    170

    Re: The use of USB with the 18F2550

    What VDD are you using and what do you have connected to pin 14 VUSB?

    You would typically enable the VREGEN to get 3V3 from the internal regulator on VUSB. You don't normally need anything...
  37. Replies
    24
    Views
    170

    Re: The use of USB with the 18F2550

    Then you want CDC. It will act as a virtual COM port on your PC.
    You can use pretty much any terminal software on your PC that would work with a normal RS232 serial COM port.
  38. Replies
    24
    Views
    170

    Re: The use of USB with the 18F2550

    If you're using Win7 you'll need a .inf file to get windows to associate the CDC device with the default usbser driver and assign a virtual COM port. HID devices don't need one.

    There used to one...
  39. Replies
    11
    Views
    1,047

    Re: UART and USB Issues with PIC18F97J94

    Looking at the asm code produced for hrsout3 and hrsout4, it would appear that there's a mistake in the instruction used to access TXREGx:


    __hrsout3__
    movlb 15
    btfss PIR6,PP_TX3IF
    ...
  40. Replies
    11
    Views
    1,047

    Re: UART and USB Issues with PIC18F97J94

    I can't speak to the uart issue, but I do know there's an error on the datasheet regarding the USB memory.

    The USB BDT ram is located at 0x100-0x1FF (bank 1), not 0xD00 (bank 13) as the datasheet...
  41. Re: Advice on migrating from 16F628A to 16F18344

    According to the manual supposedly there is.

    The 16F18344 is a lot more flexible than the old chip. Instead of being stuck using a fixed comparator pin and software SERIN, you could always use the...
  42. Re: Advice on migrating from 16F628A to 16F18344

    I haven't actually used a 16F18344, but from looking at the datasheet...

    1. It appears that there's a 32MHz setting for the intosc using just the CONFIG bits, so that should be all you need.

    2....
  43. Replies
    11
    Views
    188

    Re: Dspic33Fj128MC706A UART pic18F25K80

    I think basparky is having a problem with the 18F25K80 side of things...

    That's where his HRSOUT is giving him grief... it's not sending his binary packet.
  44. Replies
    11
    Views
    188

    Re: Dspic33Fj128MC706A UART pic18F25K80

    The library routine [email protected] terminates when it sees a 0 byte in the array.

    [email protected] is called when using


    Dim StrToMain[10] As Byte

    HRSOut Str StrToMain

    ; generated asm
  45. Replies
    11
    Views
    188

    Re: Dspic33Fj128MC706A UART pic18F25K80

    I don't know if it's always been this way, but you're right... the 'STR' modifier is causing it to treat the array as a null-terminated string, and not just an array of bytes. If you want to send...
  46. Replies
    71
    Views
    3,431

    Re: Temperature Controller Problem

    main:
    If x=0 And bttn=1 Then x=1
    DelayMS 20
    If x=1 And bttn=1 Then x=0
    DelayMS 20

    If 'bttn' (PORTA.2) is depressed for more than 20ms then 'x' will never be 1 after this.
    It will be set...
  47. Re: Unable to change device using prplus.exe command-line

    I second that! I only use it when absolutely forced to, and it's always a struggle.

    On the other hand, I find MPLAB 8.92 very useful. It has a simulator included but it doesn't easily support...
  48. Re: Unable to change device using prplus.exe command-line

    I doubt that. The latest version of mpasm is v5.84 from mplabx 5.20. Perhaps you're referring to MPLAB 8.60, in which case your assembler is very old.

    Proton is currently using mpasm 5.77 (which...
  49. Re: Unable to change device using prplus.exe command-line

    Also, the .bat file posted by keytapper uses the assembler in "\Microchip\MPASM Suite", which is very likely a different version than that used by the compiler.

    On my system the assembler in that...
  50. Re: Unable to change device using prplus.exe command-line

    Thanks for confirming that.

    So when you build with mplab there's no point in using any of those options... just set the 'device=' directive?
    The manual (and plugins) still lead you to believe it...
  51. Re: Unable to change device using prplus.exe command-line

    Thanks, but your .bat file uses pretty much the same command line I'm using...
    "ProtonIDE\PDS\PrPlus.exe myfile.bas -p18F26K22 -z"

    I don't see any reason to run mpasm or mplink afterwards. PrPlus...
  52. Re: Unable to change device using prplus.exe command-line

    I got it from looking at the command line used when compiling with MPLAB.
    It uses the info in the Proton.mtc file when you install the mplab plugin.
  53. Unable to change device using prplus.exe command-line

    Does the command-line compiler support changing devices when used in free mode?
    It seems to be ignoring the '-p' command-line switch.

    When I try "PrPlus.exe myfile.bas -p18F26K22 -z" it compiles...
  54. Replies
    5
    Views
    39

    Re: Correct terminolgy

    Your first guess was right. 'unsigned integer' is exactly what it's commonly called.
  55. Replies
    6
    Views
    52

    Re: Floating point strangeness

    It would appear that it's interpreting PotVal as a signed value even though it's declared as a 'word'.
    32768 would be 0x8000, so that's the smallest signed 16-bit value (-32767) if you're using 2's...
  56. Replies
    44
    Views
    2,584

    Re: Boot loader woes.

    Do you have the 5V from the download cable connected to your board or just RX,TX and GND?
    If you do then don't externally power the board when using the cable.

    It's a very common problem to have...
  57. Replies
    6
    Views
    810

    Re: Proton on Arduino hardware .....

    The UMC bootloader I posted in your "bootloader woes" thread works for me with an 18F25K22, a TTL download cable, and the Proton IDE.

    I don't remember you following up with any questions/problems.
  58. Replies
    34
    Views
    2,526

    Re: i need help for 12F1571 pwm

    John,

    In that wiki article you state

    The number you show there is for 31 bits. For 23 bits the max is 2^23 - 1, which is 8388607. That drops you down to 7 decimal digits, not 9 or 10.

    That's...
  59. Replies
    34
    Views
    2,526

    Re: i need help for 12F1571 pwm

    I have no idea what that statement in the manual is trying to say.

    The 8-bit compiler uses the Microchip 32-bit float format which gives you a range of approx 1E-37 to 1E+38
    As you say, there are...
  60. Replies
    34
    Views
    2,526

    Re: i need help for 12F1571 pwm

    Make sure you're not confusing the device with the core type.
    A "12-bit device" means a 12-bit core but doesn't mean all PIC12xxxxx devices.
    The 12F1572 is a 14-bit core device... when in doubt...
  61. Replies
    44
    Views
    2,584

    Re: Boot loader woes.

    For everything to be automatic the Microcode loader needs a way of resetting the pic so that the bootloader runs.

    If you have a true RS232 setup (with a MAX232 on your board) this is done by...
  62. Replies
    44
    Views
    2,584

    Re: Boot loader woes.

    I'll try this again.

    Attached is the hex file for a umc bootloader for the 18F25K22. It is set to use the internal osc @ 16MHz and UART1 (RC6 and RC7).
    Load the hex file and program it into the...
  63. Replies
    12
    Views
    140

    Re: clear and interrupt handler - problem?

    Yes it does. It initializes the variable at the start of the main routine.
  64. Replies
    44
    Views
    2,584

    Re: Boot loader woes.

    As long as you're using a USB-TTL adapter like the CA42 you do not need to invert any of the signals, just connect TX->RX and RX<-TX (and GND of course).

    You shouldn't connect anything with a...
  65. Re: Help with ppi and def files for 24FJ256GA704

    From what I recall the 24EP/33EP family use EDS memory.
  66. Re: Wanted 18F25K22 bootloader for purchase .....

    Here's the asm and hex for an 18F25K22 umc loader. It's built for using the int osc @ 16MHz

    I haven't used it in eons but I think it works.
  67. Replies
    19
    Views
    110

    Re: PicKit4, cosa ne pensate?

    There's a command line utility for the PK4 (IPECMD), so if you can get a PK3 to work with PDS I would think you should be able to get the PK4 working as well.

    FWIW the PK3 is available for half...
  68. Re: Compile to HEX from Assembler plugin - HELP

    On my system the assembler plugin is looking for the assembler in C:\Program Files (x86)\ProtonIDE\PDS\bin\mpasmwin.exe,
    but the assembler is actually located in \ProtonIDE\PDS\Includes\mpasmwin.exe...
  69. Re: PIC24FJ256GA705 Family Devices Are They Fully Supported in Proton 24 ?

    Not really.

    There's a 6-pin SIL header that you could use an external tool to program it with (PK3/4/ICD3/4),
    but you'd' likely need MPLABX/IPE to program it.

    PICkit3Plus perhaps??? No idea...
  70. Replies
    7
    Views
    39

    Re: pic16f689 tx problem

    It looks like the formal names for the FOSC config setting are as follows (from MPASM 8bit_device.info file):


    <FOSC><Oscillator Selection bits><7><8>
    <LP><LP oscillator: Low-power crystal on...
  71. Replies
    7
    Views
    39

    Re: pic16f689 tx problem

    So you're saying that if you have the config set for INTOSCIO and


    XTAL = 8

    OSCCON = 0x70


    you don't get 8MHz (2MHz on the CLKOUT pin)?
    That's odd... I would have thought that would...
  72. Replies
    7
    Views
    39

    Re: pic16f689 tx problem

    I assume you mean INTOSC.

    The default OSCCON setting at pon is for 4MHz. Have you changed it to get 8MHz?
  73. Replies
    11
    Views
    55

    Re: Setting the A/D range to 1Volt range

    He is (parameter A20). Not only that, but all the linearity, offset, and error specs are qualified with "delta VREF = 3V".
    That's one of the reasons I didn't suggest using +/-VREF initially... there...
  74. Replies
    11
    Views
    55

    Re: Setting the A/D range to 1Volt range

    As long as your signal doesn't exceed VSS(GND) or VDD you'll be ok.

    For the other part, there's no "offset" function in the K22 ADC, so I think you'd have to do that externally. You could use the...
  75. Replies
    4
    Views
    31

    Re: High impedence opamp quesion

    In the non-inverting configuration you can pretty much ignore the resistors... the input impedance will be the impedance of the non-inverting input of the opamp.

    That's one of the advantages vs...
  76. Re: ADC alternative way to capture Data using nbuilt Fix voltage reference

    All of this would be great if the internal FVR was actually usable as a reference.

    On most devices the "reference" output is +/-6%, with about a 2% change over temperature.
    If you're using a...
  77. Replies
    5
    Views
    250

    Re: 18F26J50 and 18F26K53 as Hosts?

    None of the 18F's can be a USB host.. they would need to at least have USB OTG hardware, and they don't.

    Perhaps they mean that the J50 and J53 can be used as the USB keyboard device.
  78. Replies
    11
    Views
    35

    Re: PIC18F47K40 and Hserout

    If that's the case then things are going to go south very quickly.

    There's no way to manually get that right, at least not a way that won't end up causing problems later on when things change.
  79. Replies
    1
    Views
    23

    Re: maximum hbusout speed

    Not as far as I know. I2C HS mode requires different drivers on the bus lines.
    There may be a PIC32 device or two that supports it, but most standard parts don't.

    I've had success increasing the...
  80. Replies
    1
    Views
    58

    Re: SHOUT and PIC16F18877 - problem

    Since SHOUT is a bit-banged routine it doesn't use any of the SSP registers/functions.

    I'm pretty sure you need to specify PORT pins and not LAT pins so that it can calculate the TRIS register...
  81. [SOLVED !] Re: Ports not working when using PORTA = %111111

    It's not my intent to be rude, but you should pretty much ignore everything in post #5.
  82. Replies
    4
    Views
    33

    [SOLVED !] Re: Serin signal line High or Low

    For hardware, a UART input/output normally idles high.

    With RS232, the MAX232 inverts the signal.
  83. Replies
    57
    Views
    461

    Re: Beta Testers Wanted

    MPLAB 8.92 only supports up to the Pickit3/ICD3.

    You need MPLABX for the Pickit4/ICD4. That's a rabbit hole you probably don't want to go down if you can avoid it.
    The IPE programming app isn't...
  84. Replies
    57
    Views
    461

    Re: Beta Testers Wanted

    Not sure where you see that, but the K22 is still in production and isn't going anywhere. It's not THAT old!

    The K42 is a different core. If you wanted to switch to something a little more recent...
  85. Replies
    57
    Views
    461

    Re: Beta Testers Wanted

    Either one. You can debug at the source code level, set breakpoints, single step, view registers, watch variables, etc


    There's some info in the PDS docs about using Proton with MPLAB that talks...
  86. Replies
    57
    Views
    461

    Re: Beta Testers Wanted

    My suggestion would be to throw away all your simulators and software debugging packages and use the pickit along with MPLAB 8.92 to do proper hardware debugging.

    It takes a little getting used to...
  87. Replies
    13
    Views
    39

    Re: Cheap programmer or waste of money

    Supposedly not. The Pickit4 and ICD4 are supposed to have all the device programming info internal so it doesn't reload it each time you change devices.

    As you change versions of MPLABX it'll...
  88. Re: How many digit after the comma a negative float variable can take

    If you're talking about the decimal point position, it really doesn't matter much where it is until you start to approach the extreme end of the range (E+-38, or there abouts). You get 6-7 decimal...
  89. Replies
    13
    Views
    39

    Re: Cheap programmer or waste of money

    The SNAP only does low-voltage programming (LVP) so it doesn't work with many older chips or ones that have been programmed with LVP OFF.
    It also can't be used to power the target.

    Support for...
  90. Replies
    5
    Views
    156

    Re: Can some kind soul explain this

    The CCP module uses one of the timers as its counting resource.

    In Special Event Compare mode, the CCP will automatically reset the timer for you when the timer count matches the value set in the...
  91. Replies
    8
    Views
    32

    Re: Replace existing async with sync

    Using a scheme similar to Les's (interrupt + timer) I've been able to get a bit-banged full-duplex UART at 57600, but that was on a pic18 at 64MHz. Interrupts and timers count in your 'no peripheral'...
  92. Replies
    8
    Views
    32

    Re: Replace existing async with sync

    If that's really the requirement (no peripherals) you're going to have to use a slow protocol so that the pic has time to deal with receiving transfers.

    Adding another layer (ie USB) usually ends...
  93. Replies
    10
    Views
    54

    Re: Floating point addition problem

    Swapping an 18F1320 for an 18F26K22 doesn't change things.

    Desired calculation:
    7038600 + 1407.803 = 7040007.803



    Dim Freq As Float
    Dim BasicFreq As Float
  94. Replies
    10
    Views
    54

    Re: Floating point addition problem

    Dim frequency As Float
    frequency=7000000
    frequency = frequency +.2 ; the value of frequency will not increase if use .1 or .2 , .3 and above work ok

    I think you're just past the limits of...
  95. Replies
    14
    Views
    79

    Re: Remote programming with Pickkit2

    If you jumper the target VDD pin to the pickit USB 5V, then make sure you never plug the pickit into a USB connector while it's connected to a powered target or bad things could happen to the...
  96. Replies
    14
    Views
    79

    Re: Remote programming with Pickkit2

    The specified current limits when using the pickit to power the target are:
    PK2 25mA
    PK3 30mA
    PK4 50mA

    As Charlie says, you can usually get more than that but it's something to keep in mind....
  97. Replies
    14
    Views
    79

    Re: Remote programming with Pickkit2

    Eventually the pickit4 might be an option, but right now the programmer-to-go function isn't implemented and the SD card is non-functional.
    Also, support for older devices is sketchy.

    You didn't...
  98. Replies
    14
    Views
    79

    Re: Remote programming with Pickkit2

    It's only 15 pages, and most of it is about using different power adapters to power the PK2.

    If your question is "does the PK2 lose the program if you remove power" then the answer is no.
    The hex...
  99. Replies
    14
    Views
    79

    Re: Remote programming with Pickkit2

    The PK2 programmer to go users guide has all the details

    http://ww1.microchip.com/downloads/en/DeviceDoc/PICkit 2 Programmer-To-Go User Guide b.pdf
  100. Replies
    4
    Views
    24

    Re: Don't care bits

    There's no way to do that George. As you say, you're stuck writing it as 0 or 1.

    Your safest bet is to set it to the state specified in the register summary, like 'U-0' for an unimplemented bit...
  101. Replies
    10
    Views
    930

    Re: Suggestions for pic microcontroller

    Compared to the 89S52, the 16F886 has more flash, more ram, and eeprom.
  102. Thread: 16f753 DAC

    by tumbleweed
    Replies
    11
    Views
    336

    Re: 16f753 DAC

    At a minumum, remove this line:


    DAC1CON0=0

    You're overwriting the setup that's done by DAC_Initialise()

    I would also leave the DAC output pin set to analog mode (but I think that may...
  103. Replies
    9
    Views
    75

    Re: Single character lines

    Thanks.

    Now I can actually read the last post!
  104. Replies
    17
    Views
    61

    Re: 18F47K40 Port B issue

    It varies with different devices, and the temperature range you're working over. You really have to look at the individual datasheet specs.

    For example, the 46K22 is spec'd +/-2% over the range 0...
  105. Replies
    17
    Views
    61

    Re: 18F47K40 Port B issue

    I'm not exactly sure what you mean by that, but you might need to clear the slew-rate register(s) SLRCONx.
    They default to slow mode and need to be set = 0 for normal speed.
  106. Re: Is PortB weak pull-out good enough for for units that requires pullout?

    It depends on the device, but the weak pullup current is usually spec'd somewhere in the range of 25uA-300uA at 5V, so that's about 200K to 16K, with 38K given as the typical value.
  107. Re: Detecting for the presence of pulses not using interrupts

    The 18FxxK40 (and some of the other newer ones) has interrupt on change on ALL pins if you want to use the same method as before.
  108. Replies
    6
    Views
    39

    Re: code improvement

    If you're talking about CREADing the settings and then having to do something like this:


    IOCON1bits_OVRENL = PwmOutputsLeft.0
    IOCON1bits_OVRDAT0 = PwmOutputsLeft.1
    IOCON1bits_OVRENH =...
  109. Re: Problem with Serial Port 1 on PIC18F47K40

    It would also help to have the declarations for the variables TEXTO_PS and P_ENVIO_BLUE
  110. Re: Hardware suggestion - stand alone (no particular compiler) debugger

    I doubt it.

    Trouble is, Mchip doesn't make the OCD (On-Chip Debugger) specification publicly available even if you wanted to do one.

    There's some reverse-engineered stuff out there, and an...
  111. Thread: Debugger

    by tumbleweed
    Replies
    7
    Views
    55

    Re: Debugger

    I'm with you as far as MPLABX goes, but MPLAB8 isn't THAT bad. At least it works, which is more than I can say about my experiences with MPLABX.

    I've used the MikroE tools in the past and had a...
  112. Thread: Debugger

    by tumbleweed
    Replies
    7
    Views
    55

    Re: Debugger

    There's not a lot to pick from. Other than the mchip tools the only ones I'm aware of are the MikroE and CCS debuggers and I'd have a hard time recommending either of them since it pretty much locks...
  113. Replies
    3
    Views
    41

    Re: Microchip assembler version?

    If you go looking for it, it's installed in the 'ProtonIDE\PDS\Includes' folder

    There you'll find the three files you need... mpasmwin.exe, 8bit_device.info, and 8bit_device.dll
  114. Replies
    3
    Views
    41

    Re: Microchip assembler version?

    The installer uses mpasm 5.77 (from mplabx 4.10)
    The most current version is mpasmx 5.82 (from mplabx 5.10)

    Compared to 5.77, 5.82 adds support for:
    PIC16F18445
    PIC16F18425
    PIC16F18444...
  115. Replies
    2
    Views
    35

    Re: Odd USART behaviour

    The compiler doesn't initialize the uart unless it sees a call to one of the HRSxxx or HSERxxx routines somewhere in the code.
    It doesn't have to be executed... it just has to see it in order to...
  116. Re: Tone detection with Goertzel's algorithm

    model B = original formula
  117. Replies
    14
    Views
    62

    Re: PIC18F1330 PLL problem

    Quoting my own post...
    That comment is wrong.. it enables the primary CLOCK, not the primary OSC.

    That's always confuses most (including me), since they use "Primary" to describe two different...
  118. Replies
    14
    Views
    62

    Re: PIC18F1330 PLL problem

    Try setting the lower two bits of OSCCON[1:0] (System Clock Select SCS1:SCS0) to 00.
    That will enable the Primary Osc (the one set by the config bits).

    It's not very intuitive, but on many chips...
  119. Replies
    7
    Views
    47

    Re: Watchdog timer

    You have to continuously execute a CLRWDT at least once before every timeout period or the watchdog will fire and reset the pic.

    You should probably start with one CLRWDT in your main program...
  120. Replies
    7
    Views
    47

    Re: Watchdog timer

    Most PICs (all?) include a builtin hardware watchdog timer module.
    You typically enable it via config settings, and tickle it with a CLRWDT instruction.

    That way you're not dependent on...
  121. Replies
    29
    Views
    1,519

    [SOLVED !] Re: Simple timer

    Dim onn As Byte

    If onn < 0 Then PORTB.1=1 ;relay off

    A 'byte' is unsigned, so it can never be negative (< 0)

    If you subtract 1 from a byte that's = 0 you'll get 0xff (255)
  122. Replies
    36
    Views
    190

    [SOLVED !] Re: Mysterious PORTB problem

    I agree with Stephan.

    Why use error-prone statements like

    Nop
    Movf PORTB,0,0
    Nop
    OldPORTBstate = WREG
    as opposed to the simpler "OldPORTBstate = PORTB".
  123. Replies
    13
    Views
    65

    Re: Convert Integers to Float

    It looks like you're mixed signed and unsigned variables in the 'results'.
    It also seems that the '//' remainder operator returns an unsigned result. Don't know if that's intended or not, but you...
  124. Replies
    13
    Views
    65

    Re: Convert Integers to Float

    I still don't understand what this macro is used for and why it's needed.

    Can you give some examples of using it where just assigning a value to a float variable doesn't work?
  125. Thread: Symbol

    by tumbleweed
    Replies
    21
    Views
    62

    Re: Symbol

    Stack underflow comes from the code in post #13, which as Rox pointed out needs to be changed to move the update sub after main or put a "goto" to jump around it.

    As written, it hits the return...
  126. Re: How to pick apart a binary include file

    Maybe it's just me, but I don't see any file attached to that 2nd upload
  127. Re: How to pick apart a binary include file

    hadv,

    Can you show a working example of that?

    If I try


    vendorcode:
    Include "vendor_code.bin"
  128. Re: How to pick apart a binary include file

    I don't think there's any way of directly including the binary data into your source file.
    AFAIK, you'd have to translate the bin into ascii hex text, and edit it adding "CDATA" statements to get it...
  129. Re: How to pick apart a binary include file

    Out of curiosity, what does the vendor say you're supposed to do with the bin file?
  130. Replies
    12
    Views
    777

    [SOLVED !] Re: Pulse counter memory problem

    Bob beat me to it.

    Also, if you look at your main loop...


    N=ERead 03

    main:
    If PORTA.3=0 Then EWrite 00,[N]
  131. Replies
    8
    Views
    26

    Re: EEPROM write time

    Instead of waiting a fixed amount of time, after you write it's better to wait for either PIR2.EEIF = 1 or EECON1.WR = 0.
    If you use EEIF you should clear it before writing since it remains set...
  132. Re: Why stays a part of RAM empty when I turn on RC1IE (18F45K40)?

    Context Save
    GIE = 0 ;- Interrupts in the interrupt-routine OFF for a moment
    PEIE = 0 ;/

    Verder:
    PEIE = 1 ;\
    GIE = 1 ...
  133. Replies
    3
    Views
    17

    Re: Help With I2C and Lidar ?

    I don't have one of those to try, but looking at the datasheet the I2C operations look like they should be:
    Use I2COut to set register addresses and send data
    When you use I2CIn to read, you must...
  134. Replies
    9
    Views
    55

    Re: Assembler to Proton

    I think that looks something like this...


    Dim cap1 As Word
    Dim cap2 As Word
    Dim flags As Byte

    iserv:
    If flags.0 = 0 Then ' 1st capture flag set?
    flags.0 = 1 ' no, set 1st...
  135. Re: 16F15345 Won't Assemble (but does compile)

    I can think of a few nasty kludges, but since you had to define some of the register symbols it looks like the libraries need some work for that device.

    One thing you could try as an experiment is...
  136. Re: 16F15345 Won't Assemble (but does compile)

    You shouldn't have to unlock the PPS or enable any of the PIE settings.

    It seems that when you use HRSIN and specify a timeout it's not looking in the proper register for RCIF... it's assuming...
  137. Replies
    103
    Views
    331

    Re: Malware on this website?

    Doesn't the Search Console assist in identifying the issue before submitting it for review?
  138. Replies
    103
    Views
    331

    Re: Malware on this website?

    Their diagnostics aren't that helpful, either

    http://google.com/safebrowsing/diagnostic?site=http://www.protonbasic.co.uk/
  139. Re: Best choice, 18F26K22 or 16F18857 for Mat/Calc. IOC Edge trigger?

    That's a really good point, George, and one worth pointing out.

    In my experience, the code sequence


    High PORTB.4
    High PORTB.5

    Actually writes to the LAT registers (uses a "bsf LATB", no...
  140. Re: Best choice, 18F26K22 or 16F18857 for Mat/Calc. IOC Edge trigger?

    So it's not a RMW effect, otherwise PORTB.4 and PORTB.5 wouldn't both be high.

    If it were RMW, the solution is to write to the LATB register instead of the PORTB register.
    Write to the LAT, read...
  141. Re: Best choice, 18F26K22 or 16F18857 for Mat/Calc. IOC Edge trigger?

    On the 26K22 PORTB.0 is an analog pin, so it'll always read '0' if it hasn't been switched to digital mode...
  142. Re: Has anyone code to set up a firewing board 18f... to talk via the USART/USB?

    Here's a little echo program that I just ran on the FW18 board programmed via the icsp (PK3)


    Device = 18F26K22
    Declare Xtal = 64

    Config_Start
    ; CONFIG1H
    FOSC = INTIO7 ; (FOSC)...
  143. Re: Has anyone code to set up a firewing board 18f... to talk via the USART/USB?

    These are the settings from an old Swordfish program running on the firewing board


    device = 18F26K22
    clock = 64

    config
    // CONFIG1H
    FOSC = INTIO7, // (FOSC) = [LP, XT, HSHP,...
  144. Re: Has anyone code to set up a firewing board 18f... to talk via the USART/USB?

    Sorry, Tim. Not in Proton.

    I probably have some Swordfish code for a K22 floating around somewhere if that would be of any help...
  145. Re: Has anyone code to set up a firewing board 18f... to talk via the USART/USB?

    The interface between the main 18F and the USB uC (18F14K50) is pretty much just a uart setup for 38400.

    One think to note... if you're using the stock firmware in the 14K50 it uses the terminal...
  146. Replies
    4
    Views
    36

    Re: Trying to set ORG

    How about


    Org ((($>>4)+1)<<4)
    CData 1, 2, 3, 4


    Seems to work ok...
  147. Re: How should I handle a watchdog timer reset?

    Except for the few registers that don't get initialized, there's essentially little difference between the different forms of reset. Your code will restart just as it would at powerup, so all the...
  148. Re: Pic serial synchronous DTMF to HT9200A

    The datasheet doesn't say what the data setup time before the clock edge is, so I'd try add a delay between setting the data and the falling clock edge...


    Low PORTC.4 'set data ...
  149. Replies
    16
    Views
    116

    Re: Driving SK9822 or APA102 RGB LED's

    The SK9822 and APA102 are infinitely easier to deal with than the WS2812.

    All you need to do is send out a few bytes of SPI data at just about any reasonable frequency... none of the timing woes...
  150. Replies
    11
    Views
    78

    Re: Timer1 overflows

    I think you can leave those NOPs out.

    I don't see where you've ever written to the T1CON register to set up the timer or turn it on.
  151. Replies
    5
    Views
    32

    Re: 18F26K42 Eeprom anyone?

    That's a microchip marketing scam.

    The 18F has ram banks just like all the other chips, unless you want to use the FSR registers to access memory indirectly. THEN it's "linear".
  152. Re: Question for C/C++ and VB programmers

    In C, If you want to modify the callers variable then you have to pass a pointer to the thing you want to modify, not the value...


    // pass function a pointer to an int
    myfunct(int *b) {
    //...
  153. Replies
    9
    Views
    95

    Re: 18F26K80 SPI SHout support

    I'm a version or two behind, but I noticed that in mine the xxK80.def files seem to have the ANCON0/ANCON1 setting around the wrong way, hence why I suggested setting them to 0.

    I don't know how...
  154. Replies
    9
    Views
    95

    Re: 18F26K80 SPI SHout support

    I don't know how you're setting the analog/digital mode of the pins, but try adding


    ANCON0 = 0
    ANCON1 = 0
    to the beginning of your program and see if SHOUT works. That'll force the pins to be...
  155. Replies
    8
    Views
    65

    Re: Serout pace time and stopbit setings

    You sure got that right, George.

    Bit-banged async input is almost always a recipe for disaster.
  156. Replies
    8
    Views
    65

    Re: Serout pace time and stopbit setings

    For serial input it really doesn't matter if the sender is using 2 stop bits or not... you'll receive the data just fine with the RX set to 1 stop bit.
  157. Replies
    41
    Views
    3,913

    Re: 18F24k20 Handbrake Stuck

    Not to get in Alberto's way, but a few things to look out for:

    Set PPS1WAY = Off in the CONFIG block

    And for a possible solution to your lookup problem-


    Symbol SEGMENTS = PORTB 'PORTTB...
  158. Replies
    41
    Views
    3,913

    Re: 18F24k20 Handbrake Stuck

    There's no OSCCON, but there is OSCCON1 which is somewhat similar.

    Look at table 4-1. The CONFIG setting
    RSTOSC = HFINTOSC_1MHZ ;HFINTOSC with HFFRQ = 4 MHz and CDIV = 4:1starts you off with:...
  159. Replies
    7
    Views
    48

    Re: Preprocessor output to assembler

    Not sure if this is what you're after or not, but after you compile if you hit F2 it'll open an assembly window with the output results.
  160. Replies
    12
    Views
    120

    Re: Slightly surprised by 18F26K22

    No, it's not going to hurt anything.

    If you're using the pin as an output then the 4.7K pulldown likely won't change much... just add a little more loading, so another mA or so of current out of...
  161. Replies
    12
    Views
    120

    Re: Slightly surprised by 18F26K22

    Depending on what you're doing keep in mind there's a 4.7K pulldown resistor on the PGC/PGD lines of the pickit2, pickit3, and ICD3.
  162. Replies
    20
    Views
    246

    [SOLVED !] Re: Problem in pulse per second meter

    If you setup the display scanning to be done by a timer interrupt, the display will be pretty much rock solid and won't vary.
    TMR2 is probably the easiest since you can set it up and it'll run...
  163. Replies
    8
    Views
    79

    Re: Problem with PIC16F18326

    There seems to be an error in the P16F18326.ppi file.

    The two entries:

    TRISA EQU 0X0080
    TRISC EQU 0X0082

    Should be:

    TRISA EQU 0X008C
  164. Thread: Tris

    by tumbleweed
    Replies
    11
    Views
    90

    Re: Tris

    I dunno George. I don't have any good ideas.

    You can read the PORT reg and get the current state of the pins, but much past that I think you're sorta SOL.
  165. Replies
    5
    Views
    74

    [SOLVED !] Re: What's killing my chips?

    I don't remember all the particulars but I think it has to do with which of the two methods it uses to get into ICSP mode and the order of VDD/VPP.

    The safest thing is to always leave MCLR enabled...
  166. Thread: Tris

    by tumbleweed
    Replies
    11
    Views
    90

    Re: Tris

    I don't think there is.

    Let's say you're using the MSSP I2C and you send a START. You'd end up with SCL and SDA being asserted low, but the TRIS bits would still be '1'.

    You could read the...
  167. Thread: Tris

    by tumbleweed
    Replies
    11
    Views
    90

    Re: Tris

    I took George's question to be asking if the TRIS register changes, but I could be wrong.

    Once you enable certain peripherals (like the uart and I2C) they take control of the pin direction, but...
  168. Thread: Tris

    by tumbleweed
    Replies
    11
    Views
    90

    Re: Tris

    a.

    (but it wouldn't surprise me if you find a chip where it means b. With PICs you're best off assuming there's no such thing as a "typical" part)
  169. Replies
    5
    Views
    74

    [SOLVED !] Re: What's killing my chips?

    What you describe is common when you use the internal osc, disable MCLR, and set the pins used for programming to outputs (PGC, PGD). That's not a good combination.

    In this condition, once you...
  170. Re: E32-TTL-100 and PIC18F24K40 - Requirement for marriage Councelor

    Just FYI...
    Not timing-wise.

    Uarts begin sampling each bit at the 50% time. If you divide that up across 10bits (start+8+stop) that gives you about a 5% per bit tolerance that should work, but...
  171. Re: E32-TTL-100 and PIC18F24K40 - Requirement for marriage Councelor

    Are you saying you can't use the hardware uart because of the pins you've connected?
    Which ones are you using? The K40 has PPS so you might be able to remap the uart pins.
  172. Re: E32-TTL-100 and PIC18F24K40 - Requirement for marriage Councelor

    The uart interface seems fairly standard (9600 baud, 8N1) so it's hard to see the stop bit being a problem.

    I assume you've verified the basics (3V3 logic levels, pic osc freq set correctly, 9600...
  173. Re: E32-TTL-100 and PIC18F24K40 - Requirement for marriage Councelor

    Software uart receive can be very problematic. I'd steer clear of it unless it was my only choice.
  174. Replies
    32
    Views
    382

    Re: New PICkit 4 available

    It doesn't seem to change color after it's successful, but then again I don't see it change to red when it fails, either. After powerup, for me it stays mostly green or yellow(orange?) depending on...
  175. Replies
    4
    Views
    182

    Re: 32khz oscillator on 18F26K22 problem

    The secondary osc (SOSC) connections are on RC0 (SOSCO) and RC1 (SOSCI).

    See datasheet sections 12.2 and 12.4
  176. Replies
    32
    Views
    382

    Re: New PICkit 4 available

    The MPLABX online help has descriptions of the LED bar meanings.

    Indicator Light Strip
    The expected start-up sequence for the MPLAB PICkit 4 debugger is:
    1. Purple - steady on for approximately...
  177. Replies
    32
    Views
    382

    Re: New PICkit 4 available

    I just got mine too. Still feeling my way around.

    It's missing support for a number of chips, including the 16F88 you mentioned. That's what the red ball indicates.
    The ball will show...
  178. Replies
    32
    Views
    382

    Re: New PICkit 4 available

    Ahhhh. THAT explains the new dept they opened up after the recent Atmel acquisition!

    Something tells me it's time to buy stock in bananas...
  179. Replies
    32
    Views
    382

    Re: New PICkit 4 available

    You have to have a program of some sorts to communicate to the tool. I think it's just a little early yet*.

    The MPLABX IPE v4.15 programming app handles the pickit4, just no command-line driver....
  180. Replies
    32
    Views
    382

    Re: New PICkit 4 available

    It depends on the programmer.

    The old Pickit2 and ICD2 were self-contained. They could be updated, but they held all of the algorithms internally and didn't need to download anything.

    That...
  181. Replies
    32
    Views
    382

    Re: New PICkit 4 available

    I looked in the IPECMD docs for the newly released V4.15 and the PK4 isn't mentioned yet.

    I'd imagine they'll be adding it now that the PK4 is actually being delivered. They still don't even have...
  182. Replies
    32
    Views
    382

    Re: New PICkit 4 available

    Supposedly it also works with MPLABX IPE (ver 4.15).

    I haven't looked to see if there are command-line drivers yet.
  183. Replies
    30
    Views
    170

    Re: PicKit 2 stopped working

    Running out of ideas (at least easy ones).

    Go to http://www.uwe-sieber.de/misc_tools_e.html and download the DeviceCleanupTool http://www.uwe-sieber.de/files/devicecleanup.zip

    Unplug the PK2...
  184. Replies
    14
    Views
    78

    Re: XTAL value for internal OSC 31KHz...

    31khz gives an instruction time of about 128us for a single-cycle asm instruction.

    You likely won't need a 'delayms' function, that's for sure!
  185. Re: Best choice, 18F26K22 or 16F18857 for Mat/Calc. IOC Edge trigger?

    If you were using the I2C Hbus routines inside the ISR you would have to disable interrupts in your main code around any I2C accesses.

    You can't use the bus in both the ISR and your main routines...
  186. Replies
    30
    Views
    170

    Re: PicKit 2 stopped working

    fwiw (if anything) - on win7 the PK2 appears with a device name of "PICKit 2 Microcontroller Programmer" when you power it up into bootloader mode (push the red button while inserting it into the usb...
  187. Replies
    30
    Views
    170

    Re: PicKit 2 stopped working

    Charlie -
    Where exactly did you type Ctrl-F that started this mess?
  188. Replies
    15
    Views
    1,707

    Re: ASM ERROR : Linker Error

    I would have sworn yesterday it complained about these lines from the nonlinkingversion...


    dSCU_debug_v2.bas
    499: HRSOut1 13, "Unix: ", Dec0 UnixTime

    dscu_TestManage_v1.Inc
    185: ...
  189. Replies
    15
    Views
    1,707

    Re: ASM ERROR : Linker Error

    That error means your program is too big to fit into that device.
    Change to a 24FJ128GA306 and it compiles (once you get rid of the "DEC0" format specifiers)
  190. Replies
    8
    Views
    81

    Re: 3.3v circuit from a LiPo cell

    Depends on how you end up doing the pic supply since you want to limit the input voltage to the pic pin to whatever is supplying VDD.
    If you want to shut off the current draw from the monitor I...
  191. Replies
    8
    Views
    81

    Re: 3.3v circuit from a LiPo cell

    No need to switch the regulator in and out. Just pick an LDO that has a low dropout voltage and leave it enabled all the time.

    For example, the LP5912 that Gamboa pointed out has a typ dropout...
  192. Replies
    16
    Views
    82

    Re: Push or pull on fan

    I'm no fan expert but if you could watch the airflow that might help explain it.

    One thought...
    When your pushing the air through it will hit obstructions and create local "eddy currents" that...
  193. Replies
    12
    Views
    99

    Re: Simple cheap dev board needed

    I don't have win10 so I can't try it, but checkout this forum post http://www.firewing.info/forum/viewtopic.php?f=12&t=260&p=1429. If it works, please let us know.
  194. Replies
    8
    Views
    71

    Re: Which version P24 am I running?

    True, as long as you haven't installed any update patches to P24.

    In windows explorer, if you right-click on App24.exe and check its properties, 'details' will show the file version ie 1.0.4.9
  195. Re: Getting old, need help on suitability ttl vers RS232

    half-duplex doesn't mean transmit only or receive only, it means that you can't transmit and receive at the same time.

    2-wire RS485 is pretty standard... that's how most people use it.
  196. Re: Getting old, need help on suitability ttl vers RS232

    Maybe I missed something, but half-duplex RS485 only uses 2 lines (D+ & D-), same as RS232 (TXD & RXD)
  197. Re: Best choice, 18F26K22 or 16F18857 for Mat/Calc. IOC Edge trigger?

    INT0, INT1, and INT2 are edge-triggered and can be set for active-high/active-low.
    That may be easier than using IOC.

    Edge interrupts are latched, so you'll never miss one.
  198. Re: Getting old, need help on suitability ttl vers RS232

    You should be able to fit half-duplex RS485 onto 4 wires... +V, GND, D+, D-

    In a high noise environment, differential should work out better. Plus you typically get better electrical protection vs...
  199. Replies
    7
    Views
    99

    Re: ADC negative ref input

    Thanks for pointing that out George. They do. It's parameter A20 in Table 27-21 (delta VREF).

    Evidently it helps to wait for the morning coffee to kick in before posting. Ignore what I said...
  200. Replies
    4
    Views
    63

    Re: Macro help please

    Would it help to put the test and dummy macros into the macro file itself?

    Something like:

    'file 'blabla.inc'
    $if Diagnostic = True
    ' put your real macros here
    Dump Macro
    ...
Results 1 to 200 of 493
Page 1 of 3 1 2 3