Hi,
I have to me to the quicker one work with the developing system PIC18Flash (elektor 02/05) Flowcode performed. Unfortunately, sits on the board 18F452 in the case PLCC. Because this is not Pinkomptibel with in the case DIL40, I try to provide according to the MM forum to me a " new Picmicro definition file " (*.FCD). Unfortunately, I do not manage this. I receive with provide of a new Flowcodes with the purpose 18F452_1 immmer the mistake this the definition file is absent or is faulty [0x800]. Can somebody say to me what is wrong there?
Thanks
Ansgard
[b]code[/b]
[Device]
Pins=44
Ports=5
ADCPins=8
ADCBits=10
MaxClock=40000000
PrescalerBits=3
ClockDivider=4
TimerOverflow=256
ConfigAddress=0x300000
ConfigCount=14
PWMCount=2
EepromSize=256
HasAltPWM=2
Pwm2IsD4=0
ChipName=18F452_1
FlowcodeProduct=PIC
[Pins]
Pin2 = "MCLR"
Pin3 = "RA0/AN0"
Pin4 = "RA1/AN1"
Pin5 = "RA2/AN2/VREF-/CVREF"
Pin6 = "RA3/AN3/VREF+"
Pin7 = "RA4"
Pin8 = "RA5/AN4/SS1/C2OUT"
Pin9 = "RE0/RD/AN5"
Pin10 = "RE1/WR/AN6"
Pin11 = "RE2/CS/AN7"
Pin12 = "VDD"
Pin13 = "VSS"
Pin14 = "OSC1/CLKI"
Pin15 = "OSC2/CLKO"
Pin16 = "RC0/T1OSO/T1CKI"
Pin18 = "RC1/T1OSI/CCP2"
Pin19 = "RC2/CCP1"
Pin20 = "RC3/SCK1/SCL1"
Pin21 = "RD0/PSP0/SCK2/SCL2"
Pin22 = "RD1/PSP1/SDI2/SDA2"
Pin23 = "RD2/PSP2/SDO2"
Pin24 = "RD3/PSP3/SS2"
Pin25 = "RC4/SDI1/SDA1"
Pin26 = "RC5/SDO1"
Pin27 = "RC6/TX/CK"
Pin29 = "RC7/RX/DT"
Pin30 = "RD4/PSP4"
Pin31 = "RD5/PSP5/P1B"
Pin32 = "RD6/PSP6/P1C"
Pin33 = "RD7/PSP7/P1D"
Pin34 = "VSS"
Pin35 = "VDD"
Pin36 = "RB0/INT0/FLT0"
Pin37 = "RB1/INT1"
Pin38 = "RB2/INT2"
Pin39 = "RB3/CCP2"
PIN41 = "RB4/KBI0"
PIN42 = "RB5/KBI1/T0CKI/C1OUT"
PIN43 = "RB6/KBI2/PGC"
PIN44 = "RB7/KBI3/PGD"
[Ports]
PortPin3=0x0000
PortPin4=0x0001
PortPin5=0x0002
PortPin6=0x0003
PortPin7=0x0004
PortPin8=0x0005
PortPin9=0x0400
PortPin10=0x0401
PortPin11=0x0402
PortPin16=0x0200
PortPin18=0x0201
PortPin19=0x0202
PortPin20=0x0203
PortPin21=0x0300
PortPin22=0x0301
PortPin23=0x0302
PortPin24=0x0303
PortPin25=0x0204
PortPin26=0x0205
PortPin27=0x0206
PortPin29=0x0207
PortPin30=0x0304
PortPin31=0x0305
PortPin32=0x0306
PortPin33=0x0307
PortPin36=0x0100
PortPin37=0x0101
PortPin38=0x0102
PortPin39=0x0103
PortPin41=0x0104
PortPin42=0x0105
Portpin43=0x0106
PortPin44=0x0107
[PortMasks]
PortMask0=0x3F
PortMask1=0xFF
PortMask2=0xFF
PortMask3=0xFF
PortMask4=0x07
[ADCPins]
ADC0=3
ADC1=4
ADC2=5
ADC3=6
ADC4=8
ADC5=9
ADC6=10
ADC7=11
[Code]
;Substitute macros
;%c Clock Speed
;%o Operand
;%s Prescaler
;%p PortID
;%m MaskBits
;%i Inverse Mask
;%a ADC channel
;%a Config Address
;%v Config Value
;%r Interrupt Flag Register
;%b Interrupt Flag Bit
;%n Interrupt Macro Name
Directives="#include <system.h>\n#pragma CLOCK_FREQ %c\n"
MainStart="void main()\n{\n"
MainEnd="\tmainendloop: goto mainendloop;\n}\n\n"
IntStart="void interrupt(void)\n{\n"
IntEnd="}\n\n"
Initialise="adcon1 = 0x07;\n"
IntInit="\n\n"
InputCmdFull="tris%p = tris%p | %m;\n%o = port%p;\n"
InputCmdOneBit="tris%p = tris%p | %m;\n%o = ((port%p & %m) == %m);\n"
InputCmdMask="tris%p = tris%p | %m;\n%o = port%p & %m;\n"
OutputCmdFull="tris%p = 0x00;\nport%p = %o;\n"
OutputCmdOneBit="tris%p = tris%p & %i;\nif (%o)\n\tport%p = (port%p & %i) | %m;\nelse\n\tport%p = port%p & %i;\n"
OutputCmdMask="tris%p = tris%p & %i;\nport%p = (port%p & %i) | (%o & %m);\n"
DelayCmdS="delay_s(%o);\n"
DelayCmdMs="delay_ms(%o);\n"
ADCCapture="char ta, te, cnt;\nadcon1 = 0x00;\nta = trisa;\nte = trise;\n#if (%a == 0)\n trisa = trisa | 0x01;\n#endif\n#if (%a == 1)\n trisa = trisa | 0x02;\n#endif\n#if (%a == 2)\n trisa = trisa | 0x04;\n#endif\n#if (%a == 3)\n trisa = trisa | 0x08;\n#endif\n#if (%a == 4)\n trisa = trisa | 0x20;\n#endif\n#if (%a == 5)\n trise = trise | 0x01;\n#endif\n#if (%a == 6)\n trise = trise | 0x02;\n#endif\n#if (%a == 7)\n trise = trise | 0x04;\n#endif\nadcon0 = 0xc1 | (%a << 3);\ncnt =0;\nwhile (cnt <40) cnt++;\nadcon0 = adcon0 | 0x04;\nwhile (adcon0 & 0x04) ;\ntrisa = ta;\ntrise = te;\nadcon1 = 0x07;\nadcon0 = 0x00;\n"
ADCHigh="return adresh;\n"
ADCLow="char adclow;\nadclow = adresl;\nreturn adclow;\n"
ADCFull="short iRetVal;\niRetVal = (adresh << 2);\niRetVal += (adresl >> 6);\nreturn (iRetVal);\n"
InitialPortLetter="a"
ConfigData="#pragma DATA %a, %v\n"
IntHandler="if (%r & (1 << %b))\n{\n\tFCM_%n();\n\tclear_bit(%r, %b);\n}\n"
[Defines]
Define1=#define P18F452
Define2=#define MX_EE
Define3=#define MX_EE_TYPE3
Define4=#define MX_EE_SIZE 256
Define5=#define MX_SPI
Define6=#define MX_SPI_C
Define7=#define MX_SPI_SDI 4
Define8=#define MX_SPI_SDO 5
Define9=#define MX_SPI_SCK 3
Define10=#define MX_UART
Define11=#define MX_UART_C
Define12=#define MX_UART_TX 6
Define13=#define MX_UART_RX 7
Define14=#define MX_I2C
Define15=#define MX_MI2C
Define16=#define MX_I2C_C
Define17=#define MX_I2C_SDA 4
Define18=#define MX_I2C_SCL 3
Define19=#define MX_PWM
Define20=#define MX_PWM_CNT 2
Define21=#define MX_PWM_TRIS1 trisc
Define22=#define MX_PWM_1 2
Define23=#define MX_PWM_TRIS2 trisc
Define24=#define MX_PWM_2 1
Define25=#define MX_PWM_TRIS2a trisb
Define26=#define MX_PWM_2a 3
[Interrupts]
;first 3 should always be 1=TMR0, 2=RB0INT, 3=PORTB
;any other interrupts need to also have this set: "intcon.PEIE=1;\n"5
GeneralInit="intcon.GIE=1;\n"
Count=5
1=TMR0
2=RB0INT
3=PORTB
4=RB1INT
5=RB2INT
[TMR0]
;it is vital that this section remains exactly as-is (for all chips?)
Name=(this is retrieved from the resource file)
FlagReg=intcon
FlagBit=TMR0IF
EnReg=intcon
EnBit=TMR0IE
OptCnt=3
TmrOpt=3
Opt1="Clock Source Select"
Opt1Cnt=2
Opt1_1="Transition on T0CKI pin"
Opt1_1Val="t0con.T0CS=1;\n"
Opt1_2="Internal clock (CLKO)"
Opt1_2Val="t0con.T0CS=0;\n"
Opt2="Source Edge Select"
Opt2Cnt=2
Opt2_1="high-to-low transition on T0CKI"
Opt2_1Val="t0con.T0SE=1;\n"
Opt2_2="low-to-high transition on T0CKI"
Opt2_2Val="t0con.T0SE=0;\n"
Opt3="Prescaler Rate"
Opt3Cnt=9
Opt3_1="1:1"
Opt3_1Val="t0con = (t0con & 0xF0) | 0x08;\n"
Opt3_2="1:2"
Opt3_2Val="t0con = (t0con & 0xF0) | 0x00;\n"
Opt3_3="1:4"
Opt3_3Val="t0con = (t0con & 0xF0) | 0x01;\n"
Opt3_4="1:8"
Opt3_4Val="t0con = (t0con & 0xF0) | 0x02;\n"
Opt3_5="1:16"
Opt3_5Val="t0con = (t0con & 0xF0) | 0x03;\n"
Opt3_6="1:32"
Opt3_6Val="t0con = (t0con & 0xF0) | 0x04;\n"
Opt3_7="1:64"
Opt3_7Val="t0con = (t0con & 0xF0) | 0x05;\n"
Opt3_8="1:128"
Opt3_8Val="t0con = (t0con & 0xF0) | 0x06;\n"
Opt3_9="1:256"
Opt3_9Val="t0con = (t0con & 0xF0) | 0x07;\n"
[RB0INT]
Name=(this is retrieved from the resource file)
FlagReg=intcon
FlagBit=INT0IF
EnReg=intcon
EnBit=INT0IE
OptCnt=1
TmrOpt=0
Opt1="Interrupt Edge Select"
Opt1Cnt=2
Opt1_1="rising edge of RB0/INT0"
Opt1_1Val="intcon2.INTEDG0=1;\n"
Opt1_2="falling edge of RB0/INT0"
Opt1_2Val="intcon2.INTEDG0=0;\n"
[PORTB]
Name=(this is retrieved from the resource file)
FlagReg=intcon
FlagBit=RBIF
EnReg=intcon
EnBit=RBIE
OptCnt=0
TmrOpt=0
[RB1INT]
Name=RB1/INT1
FlagReg=intcon3
FlagBit=INT1IF
EnReg=intcon3
EnBit=INT1IE
OptCnt=1
TmrOpt=0
Opt1="Interrupt Edge Select"
Opt1Cnt=2
Opt1_1="rising edge of RB1/INT1"
Opt1_1Val="intcon2.INTEDG1=1;\n"
Opt1_2="falling edge of RB1/INT1"
Opt1_2Val="intcon2.INTEDG1=0;\n"
[RB2INT]
Name=RB2/INT2
FlagReg=intcon3
FlagBit=INT2IF
EnReg=intcon3
EnBit=INT2IE
OptCnt=1
TmrOpt=0
Opt1="Interrupt Edge Select"
Opt1Cnt=2
Opt1_1="rising edge of RB2/INT2"
Opt1_1Val="intcon2.INTEDG2=1;\n"
Opt1_2="falling edge of RB2/INT2"
Opt1_2Val="intcon2.INTEDG2=0;\n"
18F452 DIL40 -> PLCC
- Steve
- Matrix Staff
- Posts: 3433
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Hello,
The problem is in the [Pins] section. Every pin (from "pin1" to "pin 44") needs to have an entry, so you would need to addthe following entries:
Also, your entry "ChipName=18F452_1" is wrong. This is the real chip name for the compiler, so it needs to be "ChipName=18F452".
Save your file as something like "18F452_PLCC.FCD" to distinguish it from the original FCD file.
The problem is in the [Pins] section. Every pin (from "pin1" to "pin 44") needs to have an entry, so you would need to addthe following entries:
Code: Select all
Pin1 = "N/C"
Pin17 = "N/C"
Pin28 = "N/C"
Pin40 = "N/C"
Save your file as something like "18F452_PLCC.FCD" to distinguish it from the original FCD file.