News:

;) This forum is the property of Proton software developers

Main Menu

ANSELA

Started by Marcel_741, May 26, 2023, 01:47 PM

Previous topic - Next topic

Marcel_741

Hello,

I am happy that I can hobby now with the full version and as I load a formal project in the installed version, I revieved the message "error [line 1] : item ansela not found". As I did not recognize this remark, I looked in the Manual and search option gave 2 results. Both were examples of how te set a AN port as analoge input (as in TRIS). As it is only a very small piece of programming (let a led (GPIO.1)high or low, depending on the status of the input (GPIO.0) in a 10F200 device. I compiler formal programmimg using the 16F684 and it worked fine.

Please advise. Did I miss it in the past or is a new thing?

Thanks in front,

Marcel

rick.curl

#1
Hi Marcel-
Can you post a snippet that shows the problem?

-Rick

Marcel_741

Rick,

Yes, I will.

Marcel

trastikata

PIC10F200 does not have analog peripherals  ;) 

Dompie

The content of the 10F200.def file is very strange, obvious the wrong content:

' Always make a backup of this file if modifications are carried out.
' Modifications to this file may affect the performance of the compiler
'
' Device 16LF1779
' File Author Les Johnson.
' Creation Date 27/08/2021
'
$ifndef _16LF1779_
$define _16LF1779_

' Device Information
$define _device _16LF1779
$define _core 14
$define _ecore 1    ' Enhanced 14-bit core
............

The 10F202.def looks better but is it interchangeable, I don't know???

Johan

RGV250

#5
Hi,
As Dompie pointed out, the def file looks incorrect. The 202 has more memory but the rest looks OK, the 204 has the same memory but a comparator, the 206 has more memory and the comparator. I have just looked at all 3 in winmerge and think this might work, it is the 204 file with the comparator eddited out.

Change txt to def
12f200.txt

Just in case you did not know you need to save it in C:\Program Files (x86)\ProtonIDE\PDS\Includes\Defs

Bob

Marcel_741

hi all,

I read all your comments and thank for that.

I checked 10F200.def and add it to this message.....looks like the wrong script is placed in the conficuration of the device.

I have to correct it and I saw the option allready in Bob his contribution. Thanks for that.

I will leave a message when it solved.

Marcel

Marcel_741

#7
Hello,

Now I have OSCCAL issues, so I stop now because it starts to dizzle. I will see next time...

Regards,

Marcel

Stephen Moss

With regard to your OSCAL issue this may provide some help

Marcel_741

Stephen,

I did and came to the following.

The OSCCAL is placed in the last location of the memory in order to devine a calibration factor for the internal oscillator. This is for every device different. The datasheet (10F200) says adres o5H. I tried to declare the set_Osscal to 05h and compile it. That gave no issues.

As soon as divine the 10F200 in the programmer device and read the device, it gave an OSCCAL back. No error. Then I load the hex file and it starts to generate a error. The OSCCAL can be set manually, but that made no difference or I did not put the right one in. I tried the 10F202, 204, 206 but all the same result..Maybe I have skip these devices, but for just small project with little ammount of commands, they are very handy.

In the manual, there is a chapter about OSCCAL but it did not help me in this situatie. The written knowledge is oke for sure.

Regards,

Marcel


John Lawton

My understanding is that the OSCAL value was set by Microchip during manufacture to trim the internal oscillator so the best thing is not to erase or overwrite this value. Your programmer should be set appropriately.

RGV250

Hi,
In the def file Oscal is set to 5 and the bits are the same as the datasheet so it is probably something to do with how you are setting it. I have never used the devices but if you post a snippet of code someone else might be able to see if it is correct.

Bob

Marcel_741

Bob,

I can see the figure in the file and I asume that file is correct. When I connect the PIC with the programmer, and startup the software, there seems to be no issue. Even the OSCCAL is healty and as soon as I load the hex, it shows a invalid OSCCAL. Manually adjust the value is possible but, when trying to write to the PIC, again the ASCCAL message shows up and the healthy value changed in invalid red 0000 value. I think this is not my cup of tea.

I let it rest and concentrate on other types like the 12F629/12F675/12F683 when it comes to small projects.

Regards,

Marcel

top204

#13
I'm not sure how that mess happened in the 10F200.def file occurred, and it has the details of a totally different device in it. It happened earlier this year judging by the dates in the file, but not sure how I filled that .def file with a different device's details. It must have been one of the update installers.

I have attached the new "10F200.def" file, and it can be unzipped and placed in the folder: "C:\Program Files (x86)\ProtonIDE\PDS\Includes\Defs\", replacing the existing file.

The device's internal oscillator calibration method can be read on page 36 of the PIC10F200 device's datasheet. In section: "9.2.2  INTERNAL 4 MHz OSCILLATOR"

At the reset vector of the device is a Movlw mnemonic with the calibration value held in it, so when it is scanned, WREG holds the calibration value. So placing the Set_OSCCAL command in a program's listing will create code to load the value held in WREG into the OSCCAL SFR. Set_OSCCAL can be thought of as more of a directive than a command, because it does not place code where it is in the listing, but signals the compiler to create the OSCCAL loading assembler code before the user's program starts.

A typical program listing for a PIC10F200 device is shown below:

'
'   /\\\\\\\\\
'  /\\\///////\\\
'  \/\\\     \/\\\                                                 /\\\          /\\\
'   \/\\\\\\\\\\\/        /\\\\\     /\\\\\\\\\\     /\\\\\\\\   /\\\\\\\\\\\  /\\\\\\\\\\\  /\\\\\\\\\
'    \/\\\//////\\\      /\\\///\\\  \/\\\//////    /\\\/////\\\ \////\\\////  \////\\\////  \////////\\\
'     \/\\\    \//\\\    /\\\  \//\\\ \/\\\\\\\\\\  /\\\\\\\\\\\     \/\\\         \/\\\        /\\\\\\\\\\
'      \/\\\     \//\\\  \//\\\  /\\\  \////////\\\ \//\\///////      \/\\\ /\\     \/\\\ /\\   /\\\/////\\\
'       \/\\\      \//\\\  \///\\\\\/    /\\\\\\\\\\  \//\\\\\\\\\\    \//\\\\\      \//\\\\\   \//\\\\\\\\/\\
'        \///        \///     \/////     \//////////    \//////////      \/////        \/////     \////////\//
'                                  Let's find out together what makes a PIC Tick!
'
' A typical skeleton program listing for a PIC10F200 device
'
' Written by Les Johnson for the Positron8 BASIC compiler.
'
    Device = 10F200                             ' Tell the compiler what device to compile for
    Declare Xtal = 4                            ' Tell the compiler what frequency the device will be operating at (in MHz)
'
' Create any variables for a program here
'

'----------------------------------------------------------------------------
' The main program starts here
'
Main:
    Set_OSCCAL                                  ' Load the OSCCAL SFR with the contents of the calibration value held in flash memory

   
'----------------------------------------------------------------------------
' Set the fuses for the internal oscillator on a PIC10F200 device.
' If the MCLR pin is to be disabled, use the MCLRE_OFF symbol instead of MCLRE_ON.
'
    Config INTRC_OSC, CP_OFF, WDT_OFF, MCLRE_ON

In the assembler listing of the compiled program, you will see where the contents of WREG is loaded into OSCCAL:

;---------------------------------------------
; START OF THE COMPILER'S LIBRARY ROUTINES

_compiler__start_
    org 0x00
    movwf OSCCAL
    goto _compiler_main_start_