• Welcome to Proton BASIC Community. Please login or sign up.
 
Oct 18, 2021, 04:31 AM

News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33


Recent posts

Pages1 2 3 ... 10
1
Proton8 threads / Port B pullups
Last post by mikedownunder - Today at 03:36 AM
Hi All

I have an old project that I need to resurrect which uses a PIC 16F876A.
In the original software that I found, PORTB Pullups were enabled, but in the new compiler I get the error:
***Standard 14-=bit core devices do not support separate pin pullup resistors***
However on page 23 of datasheet DS39582C it shows in the OPTION_REG Register bit7.

Am I missing something?
Thanks
Mike
2
Positron Studio / Re: Positron Studio Update
Last post by Pepe - Oct 17, 2021, 10:35 PM
Disabling Code Block Lines works correctly but if it is enabled in version 2.0.2.11 it keeps giving the same error
3
FineLineIDE / Re: FineLineIDE
Last post by normnet - Oct 17, 2021, 06:13 PM
Quote from: top204 on Oct 13, 2021, 01:07 PMYour IDE is excellent Norm. However, the problem I have is that it does not show the assembler code in a window. :-(

Any chance of creating a child window so it loads in the asm code produced with the syntax highlighting from the "database.mcd" file?

FL keyboard shortcuts need better documentation as Ctrl + F2 will display the asm code.  Should auto-indent be disabled when displaying asm code?
4
Positron Studio / Re: Positron Studio Update
Last post by JohnB - Oct 17, 2021, 01:52 PM
Hopefully I have just uploaded a more permanent solution. 
It has been a b*gg*r to sort out but I think it is now OK.

As soon I saw your reply I removed the link to the download so hopefully not too many have downloaded yet.
I have uploaded a new version and enabled the link.  Please let me know if any other problems arise.
5
Positron Studio / Re: Positron Studio Update
Last post by Pepe - Oct 17, 2021, 12:20 PM
Thanks for the temporary solution
6
Proton24 threads / 16 Bit H and non H registers c...
Last post by diebobo - Oct 17, 2021, 09:48 AM
Hi,

Not sure about it but here we go.. I am trying to get UART working on a 33CK256MP205 device, transmit works but receiving and using Interupt just seems to be impossible. I Think i am doing al the correct things so in a despirate attempt i looked at the created .ASM file and i think that something is going wrong there..

My .Bas looks like
U1MODEbits_UTXEN = 1; //transmitter enabled
U1MODEbits_URXEN = 1; //receiver enabled
U1MODEbits_UARTEN = 1; //enable uart

The generated .ASM part looks like :

; rd_i000024_f001_000054_p000016,0 mkr$ in [test_uart.bas] U1MODE.5 = 1
    bset.b U1MODE,#5
; rd_i000025_f001_000055_p000016,0 mkr$ in [test_uart.bas] U1MODE.4 = 1
    bset.b U1MODE,#4
; rd_i000026_f001_000056_p000016,0 mkr$ in [test_uart.bas] U1MODE.15 = 1
    bset.b U1MODEH,#7

The line of interrest is bset.b U1MODEH,#7 which should set bit 15 of the U1MODE register.

So far so good i think, butttttt if look at the declares at the top of the .ASM i find this :

.equ U1MODE, 0x0238
.equ U1MODEH, 0x0239
.equ U1MODEH, 0x023a
.equ U1MODEHH, 0x023b

I guess it works like this, the 2nd line means highbyte part of register U1MODE since its 16 bits long ? The problem i think is that there is actually a register called U1MODEH, so the reference to the Highbyte of U1MODE gets overriden with the register that has the name ( 3th line ) So values which should be written to the HighByte of U1MODE in reality gets written to the Lowbyte of the register of the samen name ?

There are however a LOT of registers that also have their names ending with a H and so far as i can see they are all affected.. Please correct me of i am wrong Les.

Using the latest version of the Compiler.

Adding my test bas file for completeness.

Device = 33CK256MP205
Declare Xtal = 100

Config FSEC     = BWRP_OFF, BSS_DISABLED, BSEN_OFF, GWRP_OFF, GSS_DISABLED, CWRP_OFF, CSS_DISABLED, AIVTDIS_OFF
Config FOSCSEL  = FNOSC_FRC, IESO_OFF
Config FOSC     = POSCMD_NONE, OSCIOFNC_ON, FCKSM_CSECMD, PLLKEN_ON, XTCFG_G0, XTBST_ENABLE
Config FWDT     = SWDTPS_PS2147483648, RCLKSEL_LPRC
Config FPOR     = BISTDIS_DISABLED
Config FICD     = ICS_PGD1, JTAGEN_OFF, NOBTSWP_DISABLED
Config FDMT     = DMTDIS_OFF
Config FDEVOPT  = ALTI2C1_OFF, ALTI2C2_OFF, ALTI2C3_OFF, SMBEN_STANDARD, SPI2PIN_PPS
Config FALTREG  = CTXT1_OFF, CTXT2_OFF, CTXT3_OFF, CTXT4_OFF
Config FBOOT    = BTMODE_SINGLE

Declare Hserial1_Baud = 9600

Dim Int_Serial_String   As String * 50 ' Hier word de complete seriele RX in opgeslagen
Dim Int_Serial_Char     As Byte

Clear

GoTo Setup ' Jump over the interrupt handlers

Setup:
'         5432109876543210
Ansela = %0000000000000000
TRISA  = %1111111111111111 ' A3/A4 = Button 1 & 2
AnselB = %0000000000000000
TRISB  = %1000001011111111
Anselc = %0000000000000000
TRISc  = %1111111111111110
Anseld = %0000000000000000
TRISd  = %1111111111111111 'D3 = Button 1

' NOOIT GEEN BITS GEBRUIKEN.. WAARDE VAN 0 of 1 DEFINEREN ALS BYTE, DAN MAAR MEER GEHEUGEN GEBRUIK... BITS WERKEN NOOIT 100%, DAGEN VERSPILD MET UITZOEKEN !!!
'              9876543210
'CNPUA = %0000000000011000  ' Interne pullups Button 2 & 3'
'CNPUd = %0010000000000000  ' Interne pullups Button 1


Osc_190MHz()                                ' Set the device to run at 190MHz

PPS_Unlock()                                ' \
PPS_Output(cOut_Pin_RP46, cOut_Fn_U1TX)    ' / Set the USART1 PPS pin
PPS_input(cIn_Pin_RP47, cIn_Fn_U1RX)    ' / Set the USART1 PPS pin

IPC2.12 = 1 ' Prio 5.. 7 is t hoogst
IPC2.13 = 0
IPC2.14 = 1

IFS0bits_U1RXIF = 0;
IEC0bits_U1RXIE = 1;   _U1RXInterrupt Enable

U1MODEbits_UTXEN = 1; //transmitter enabled
U1MODEbits_URXEN = 1; //receiver enabled
U1MODEbits_UARTEN = 1; //enable uart

DelayMS 500


clear U1STA
clear U1STAh

Main:

StrN Int_Serial_String = ""
Repeat
    HSerIn 1000, Timeout_B, [Int_Serial_Char]
    Int_Serial_String = Int_Serial_String + Int_Serial_Char
Until Int_Serial_Char = 10 Or Int_Serial_Char = 13     ' Linefeed or Cariage Return

Timeout_B:
HSerOut [Int_Serial_String, 10]

hserout ["IFS0bits_T1IF   ", dec IFS0bits_T1IF,10]
hserout ["IFS0bits_U1RXIF ", dec IFS0bits_U1RXIF,10]
hserout ["GIE             ", dec intcon2.15,10]
HSerOut ["*** U1MODE ***  5432109876543210",10]
HSerOut ["*** U1MODE ***  ", bin16 u1mode, 10]
HSerOut ["*** U1MODEH *** 5432109876543210",10]
HSerOut ["*** U1MODEH *** ", bin16 U1MODEH, 10]
HSerOut ["*** U1STA ***   5432109876543210",10]
HSerOut ["*** U1STA ***   ", bin16 U1STA, 10]
HSerOut ["*** U1STAH ***  5432109876543210",10]
HSerOut ["*** U1STAH ***  ", bin16 U1STAH, 10]


GoTo Main

end

Proc Osc_190MHz()
    ' Dit is 180 mhz
    '    CLKDIV = $3001          ' FRCDIV FRC/1, PLLPRE 1, DOZE 1:8
    '    PLLFBD = 90
    '    OSCTUN = $00
    '    PLLDIV = $21            ' POST1DIV 1:2, VCODIV FVCO/4, POST2DIV 1:1
    '    ACLKCON1 = $0101        ' FRCSEL FRC, APLLPRE 1:1
    '    APLLFBD1 = $C8
    '    APLLDIV1 = $42          ' APOST1DIV 1:4, APOST2DIV 1:2, AVCODIV FVCO/4*)

    CLKDIV = 0x3001; Dit is 100mhz
    PLLFBD = 0x96;
    OSCTUN = 0x00;
    PLLDIV = 0x32;
    ACLKCON1 = 0x8101;
    APLLFBD1 = 0x7D;
    APLLDIV1 = 0x21;
    CANCLKCON = 0x00;
    REFOCONL = 0x00;
    REFOCONH = 0x00;
    RPCON = 0x00;
    PMDCON = 0x00;
    PMD1 = 0x00;
    PMD2 = 0x00;
    PMD3 = 0x00;
    PMD4 = 0x00;
    PMD6 = 0x00;
    PMD7 = 0x00;
    PMD8 = 0x00;

    Write_OSCCONH($01)
    Write_OSCCONL($01)

    While OSCCONbits_OSWEN <> 0 : Wend  ' Wait for the clock switch to occur
EndProc

Isr U1RXInterrupt

    IFS0bits_U1RXIF = 0 ' Als m hier niet reset, en er komt een nieuwe binnen terwijl de routine nog niet klaar is pakt ie de interrupt niet.. Baluh !

    HSerOut ["*** Serieel ontvangen ", 10]

    IFS0bits_U1RXIF = 0    ' hier nog een keer resetten omdat er gewoon is blijven ontvangen door de uart terwijl we m bovenaan alweer gerest hadden... Dan keert het programma weer terug naar interupt en dan is er niets meer te ontvangen = timeout..

EndIsr
7
Third party IDEs / Re: Is it possible?
Last post by John Lawton - Oct 17, 2021, 09:04 AM
+1 for Notepad++
8
Third party IDEs / Re: Is it possible?
Last post by atomix - Oct 17, 2021, 08:44 AM
VSCode != Visual Studio IDE   (This is completely different IDE.)

I use VSCode to highlight the JavaScript and LangMF code (see the extension of LangMF in VSCode), it is very flexible configured and there are many other feature, but it is really cumbersome.

And basically I use NotePad ++

For the Positron compiler, I have now switched to Positron Studio, it is very good.
9
Positron Studio / Re: Positron Studio Update
Last post by JohnB - Oct 17, 2021, 07:44 AM
Thanks.  That is really odd, it only fails with a Win 32 build and is fine with a 64bit build.
Turn off Code Block Lines and you will not get the failure.  It is because I had not catered for Do...Loop While.
I had forgotten both Loop Until and Loop While are both valid commands.
I'll issue an update shortly. 

Looking at it, this is going to take me a bit longer to resolve, I have pulled the release from the website and will re-instate it what I have coded the necessary change.
10
FineLineIDE / Re: FineLineIDE
Last post by normnet - Oct 17, 2021, 12:58 AM
See first post for download of FineLineIDE v5.0.5

v5.0.5
Added cmd line settings for MPLAB Snap programmer to options.
Pages1 2 3 ... 10