New Files for PIC24FJ1024GB606 and PIC24FJ1024GB610 Devices.

Started by top204, Dec 21, 2024, 03:11 PM

Previous topic - Next topic

top204

A very helpful user of the forum asked me if I could add the PIC24FJ1024GB606 and PIC24FJ1024GB610 devices to the Positron16 compiler, so I created some files for them this morning, and tested them with a standard program code listing.

I have attached a zip file with 'gld', 'ppi' and 'def' files for the PIC24 devices:

PIC24FJ1024GB606 and PIC24FJ1024GB610.

Unzip the attached file, which is named: "PIC24FJ1024GB606 and PIC24FJ1024GB610 Devices - 21-12-2024.zip", then copy its 'gld' folder into the compiler's 'PDS' folder, over-writing any files in the compiler's 'gld' folder that are duplicated.

The compiler's PDS folder can be found at: "C:\Program Files (x86)\ProtonIDE\PDS"

Then copy the zipped file's 'PPI' and 'Defs' folders into the compiler's "PDS\Includes\" folder, which is located at: "C:\Program Files (x86)\ProtonIDE\PDS\Includes", again, over-writing any files that are duplicated in the compiler's 'Defs' folder.

Best regards
Les

charliecoutas


Werwolf

Hi Les,
Thank you very much for such great news. I have found a PCB at home with a built-in PIC24FJ1024GB606, so it will be possible to test the performance. As there were no problems when testing the PIC24FJ1024GA606, I think it will be very good.

Best Regards
Alvydas

Werwolf

Hello Les,
I've written a small test programme:
Device = 24FJ1024GB606

Config FSEC =       BWRP_OFF, BSS_OFF, BSEN_OFF, GWRP_OFF, GSS_OFF, CWRP_OFF, CSS_DIS, AIVTDIS_DISABLE
Config FBSLIM =     BSLIM_BSLIM
Config FOSCSEL =    FNOSC_FRC, PLLMODE_PLL96DIV3, IESO_ON
Config FOSC =       POSCMD_HS, OSCIOFCN_ON, SOSCSEL_OFF, PLLSS_PLL_PRI, IOL1WAY_ON, FCKSM_CSECME
Config FWDT =       WDTPS_PS32768, FWPSA_PR128, FWDTEN_ON, WINDIS_OFF, PS25_0, WDTCMX_WDTCLK, WDTCLK_LPRC
Config FPOR =       BOREN_ON, LPCFG_OFF, DNVPEN_ENABLE
Config FICD =       ICS_PGX1, JTAGEN_OFF, BTSWP_OFF
Config FDEVOPT1 =   ALTCMPI_DISABLE, TMPRPIN_OFF, SOSCHP_ON, ALTVREF_ALTVREFDIS
Config FBOOT =      BTMODE_SINGLE


Declare Xtal = 32
Declare Reminders = Off
Declare Warnings = On
Declare Watchdog = Off
Declare ACCESS_UPPER_64k = 1
Declare Stack_Size = 256
Declare Stack_Expand = 1
Declare Dead_Code_Remove = On
Declare Create_Coff = False
Declare Optimiser_Level = 3

$define SYSCLK 32000000

Include "GT21_Init.inc"
Include "GT21_HW.inc"


CLOCK_Initialize()
Clear
DelayMS 100


MAIN:
    ;CLOCK_Initialize()
    PIC_Init()
   
    While 1 = 1
        HL11 = ~HL11
        DelayMS 1000
   
    Wend
   
Return

$ifndef _GT21_Init_inc_
$define _GT21_Init_inc_


Dim OSCCONH_Value As Byte
Dim OSCCONL_Value As Byte


Proc CLOCK_Initialize()
    ;CPDIV 1:1; PLLEN disabled; DOZE 1:8; RCDIV PRIPLL; DOZEN disabled; ROI disabled;
    CLKDIV = $3300
    ;STOR disabled; STORPOL Interrupt when STOR is 1; STSIDL disabled; STLPOL Interrupt when STLOCK is 1; STLOCK disabled; STSRC SOSC; STEN disabled; TUN Center frequency;
    OSCTUN = $00
    ;ROEN disabled; ROSEL FOSC; ROSIDL disabled; ROSWEN disabled; ROOUT disabled; ROSLP disabled;
    REFOCONL = $00
    ;RODIV 0;
    REFOCONH = $00
    ;ROTRIM 0;
    ;REFOTRIML = 0x00;
    ;DCOTUN 0;
    DCOTUN = $00
    ;DCOFSEL 8; DCOEN disabled;
    DCOCON = $0700
    ;DIV 0;
    OSCDIV = $00
    ;TRIM 0;
    OSCFDIV = $00
    ;AD1MD enabled; T3MD enabled; T4MD enabled; T1MD enabled; U2MD enabled; T2MD enabled; U1MD enabled; SPI2MD enabled; SPI1MD enabled; T5MD enabled; I2C1MD enabled;
    PMD1 = $00
    ;OC5MD enabled; OC6MD enabled; OC7MD enabled; OC8MD enabled; OC1MD enabled; IC2MD enabled; OC2MD enabled; IC1MD enabled; OC3MD enabled; OC4MD enabled; IC6MD enabled; IC7MD enabled; IC5MD enabled; IC8MD enabled; IC4MD enabled; IC3MD enabled;
    PMD2 = $00
    ;I2C3MD enabled; PMPMD enabled; U3MD enabled; RTCCMD enabled; CMPMD enabled; CRCMD enabled; I2C2MD enabled;
    PMD3 = $00
    ;U4MD enabled; USB1MD enabled; CTMUMD enabled; REFOMD enabled; LVDMD enabled;
    PMD4 = $00
    ;IC9MD enabled; OC9MD enabled;
    PMD5 = $00
    ;SPI3MD enabled;
    PMD6 = $00
    ;DMA1MD enabled; DMA0MD enabled;
    PMD7 = $00
    ;U5MD enabled; CLC3MD enabled; CLC4MD enabled; CLC1MD enabled; CLC2MD enabled; U6MD enabled;
    PMD8 = $00
    ;CF no clock failure; NOSC PRIPLL; SOSCEN disabled; POSCEN disabled; CLKLOCK unlocked; OSWEN Switch is Complete; IOLOCK not-active;
    ;__builtin_write_OSCCONH((uint8_t) ((0x300 >> _OSCCON_NOSC_POSITION) & 0x00FF));
    ;OSCCONH_Value = (($0300 >> _OSCCON_NOSC_POSITION) & $00FF)
    Write_OSCCON($0301)
    ;__builtin_write_OSCCONL((uint8_t) ((0x300 | _OSCCON_OSWEN_MASK) & 0xFF));
    ;Wait for Clock switch to occur
    While OSCCONbits_OSWEN != 0 : Wend
    While OSCCONbits_LOCK != 1 : Wend
EndProc

Proc PIC_Init()
    LATB = $0000
    LATC = $0000
    LATD = $0000
    LATE = $0000
    LATF = $0000
    LATG = $0000
   
    ;TRISB = $00FC
    ;TRISC = $2000
    ;TRISD = $0D08
    ;TRISE = $001E
    ;TRISF = $0008
    ;TRISG = $004C
   
    TRISB = $00E4
    TRISC = $4000
    TRISD = $0037
    TRISE = $000F
    TRISF = $0018
    TRISG = $0046
   
    ;Init_DMA()
    ;Init_Debug()
    ;Init_UART1($00)
   
    ;Init_T1()
   
    DelayMS 50
EndProc

Proc Init_DMA()
    DMACONbits_DMAEN = 1
    DMACONbits_PRSSEL = 0
    DMAL = $0000
    DMAH = $FFFF
EndProc
$endif '_GT21_Init_inc

Result: if I compile for PIC24FJ1024GA606 the result is OK, but if I compile for PIC24FJ1024GB606 it is negative.
In both cases the compiled program is written to the PIC24FJ1024GB606 controller. :)  Surprisingly, the "GB" controller accepts the "GA" program perfectly.


When compiling "GA" the code length is 196 words and when compiling "GB" it is 168 words.

Best Regards
Alvydas