Tutorial 02 — Setting Up Your AI Workspace
AI and PicBasic Pro Tutorial Series — Post 2 of 6
Content produced with AI assistance and reviewed by the forum administrator.






What is a Persistent Workspace?


A standard AI conversation has no memory. Close it and start a new one and the AI knows nothing about your device, your project, or anything you discussed before. Every session starts from zero.


A persistent workspace changes that. It is a named area within the AI tool where you can upload documents and write a permanent instruction. Every conversation you start inside that workspace automatically has access to those documents and that instruction — without you having to provide them again.


For PBP3 development this matters because the documents that fix the AI's knowledge gap — the compiler manual, the device datasheet, working code examples — only need to be uploaded once. After that they are simply there for every conversation.


Different AI tools call this feature different things. In Claude it is called a Project. Other tools use similar workspace, collection, or knowledge base concepts. The principle is the same regardless of the tool you are using.






Creating Your Workspace


The exact steps vary by AI tool. In general:

  1. Look for a Projects, Workspaces, or Collections section in the navigation
  2. Create a new one and give it a name that identifies the device family — for example PBP3 Mid-Range Development or PBP3 18F Projects
  3. You can create separate workspaces for different device families later


Give the workspace a name that tells you immediately which device family and compiler it covers. You may end up with several over time.






The Workspace Instruction


Most workspace features let you write a permanent instruction that the AI reads before every conversation. This is separate from the documents — it is a set of behavioural rules that apply throughout the workspace.


Here is a starting instruction you can adapt. Replace the device name with your target device:


Code:
; ============================================================
; WORKSPACE INSTRUCTION — ADAPT BEFORE USE
; Replace [YOUR DEVICE] with your actual target PIC
; Replace [YOUR CLOCK] with your actual clock speed
; ============================================================


You are an embedded systems engineer working in PicBasic Pro 3 (PBP3)
by melabs, targeting [YOUR DEVICE] at [YOUR CLOCK] MHz.


Before making any claim about PBP3 syntax, DEFINE statements, CONFIG
bits, or peripheral register behaviour, consult the reference documents
in this workspace. Do not rely on memory for device-specific details —
the documents take priority.


If you are uncertain about any DEFINE, CONFIG bit, or register
interaction, say so before proceeding. Do not approximate.


When reviewing or correcting code:
- Preserve all existing functionality unless a fault requires otherwise
- Mark every change with a comment: ; FIX [n]: description
- Justify every fix by reference to the manual or device datasheet
- Flag any assumption not supported by the documents

NOTE: This is an example instruction. Adapt it to your device and requirements before use. The device name and clock speed placeholders must be replaced.






Which Documents to Upload


Upload these in order of importance. The first two are essential. The others add significant value but can be added later.


Document 1 — The PBP3 Compiler Manual (Essential)


The PBP3 manual covers the full language: DEFINE statements, built-in functions, interrupt handling, inline assembly, and compiler directives. Without it the AI approximates PBP3 syntax from general knowledge. With it, syntax questions have a definitive reference.


The manual is available free from the melabs website at https://www.melabs.com in the support or downloads section.


Document 2 — Your Device Datasheet (Essential)


The Microchip datasheet for your target device covers CONFIG registers, peripheral registers, oscillator modes, and pin functions. AI-generated CONFIG errors almost always trace back to not having this document.


Datasheets are available free from https://www.microchip.com — search for your device part number and download the datasheet PDF.


Document 3 — Working Code Samples (Strongly Recommended)


Upload one or more PBP3 source files that compile and run correctly on your target device. These give the AI a calibration baseline — it can see what correct PBP3 for this device looks like before it touches your code. Without working samples the AI infers correct style from whatever code you give it, including broken code.


Document 4 — A Device Reference Summary (Recommended)


A short plain text document listing the DEFINE statements, standard register values, and peripheral configurations you use regularly. Even a one-page summary covering your standard oscillator setup, timer configuration, and interrupt registers prevents a significant class of errors. You build this over time as you work with the device.






Document Order and Naming


Name your documents clearly so the AI can identify them. A targeted register extract named PIC16F_Register_Reference.txt is more useful than a file called document1.pdf.


Upload the targeted reference documents before the full datasheet. The AI will reach for the most specific relevant document first when the naming makes the purpose clear.






What You Have After This Step


A workspace that opens every conversation with:

  • The AI already knowing it is working in PBP3 on your specific device
  • The compiler manual available for syntax reference
  • The device datasheet available for CONFIG and register reference
  • Working code examples as a style baseline
  • Instructions to flag uncertainty rather than approximate


The setup takes approximately twenty minutes. After that it applies to every conversation in the workspace without any further effort.






Previous: Tutorial 01 — Getting Started
Next: Tutorial 03 — Setting a Profile Instruction for Consistent Behaviour
This tutorial series was produced with AI