UBW32 and Pickit 3 enough?

Discuss the Firewing development environment

UBW32 and Pickit 3 enough?

Postby Atmega8 » Mon Mar 17, 2014 4:58 pm

Hello David,

i have an UBW32 and a Pickit 3.
For now i don't want to buy additional Hard- and Software.
IS it possible to use this Environment to write Basic Programms and to burn them into ubw32 with the Pickit?
I don't want to use the ubw32 bootloader.

How do i have to set up The IDE?
I followed your advices and installed The Microchip compiler, and i can choose it in the IDE.
But what next?

Please help me a little bit with the first steps.

Thank you,

Dietmar
Atmega8
 
Posts: 17
Joined: Mon Mar 17, 2014 3:31 pm

Re: UBW32 and Pickit 3 enough?

Postby David John Barker » Mon Mar 17, 2014 5:46 pm

I have not had any personal experience with the hardware you are talking about, but I assume you mean

http://www.schmalzhaus.com/UBW32/

Based on a PIC32MX795F512L (which Firewing supports, you don't need the Microchip compiler) . It also looks like it has an ICSP socket and a HID bootloader. I assume the loader takes standard *.hex files? If all these assumptions are correct, you have a number of options:

Use the bootloader. If it has a command line interface, you can easily integrate it into the Firewing IDE. This would give you the nicest development environment and probably be the easiest to set up. However, you state you don't want to use the loader, so

Integrate into MPLAB. At the current time, the compiler will not integrate into MPLABX as it doesn't have the required plugin. You will have to use MPLAB. First you need to set Firewing up as a toolsuite in MPLAB, instructions here:

http://www.firewing.info/pmwiki.php?n=FirewingUser.MPLAB

Create an MPLAB project and ensure you select Firewing as your toolsuite. You will also need to set a command line switch in build options. For example,

Code: Select all
 -p$(DEVICE) -t"Firewing 32"


You should make sure the device in MPLAB is set for PIC32MX795F512L and the top of your Firewing program has
Code: Select all
device = 32MX795F512L


When you build your project, you will see something like this:

Code: Select all
Clean: Deleting intermediary and output files.
Clean: Deleted file "C:\Programming\Borland\Firewing\Runtime\MPLAB Project\progMain.HEX".
Clean: Done.
Executing: "C:\Programming\Borland\Firewing\Runtime\Firewing.exe" progMain.bas -p32MX775F512L -t"Firewing 32"
Firewing BASIC Compiler 1.0.0.3 Copyright (c) 2013 Mecanique
All Rights Reserved.
ROM used : 1592 Bytes (0.30%)
RAM used : 68 Bytes (0.05%)
Loaded C:\Programming\Borland\Firewing\Runtime\MPLAB Project\progMain.HEX.
BUILD SUCCEEDED: Mon Mar 17 17:42:09 2014


Select PicKit3 as your programmer in MPLAB and connect to your development board. You should then be ready to program your board...
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: UBW32 and Pickit 3 enough?

Postby Atmega8 » Mon Mar 17, 2014 7:11 pm

Hello David,

thank you very much for your enthusistical fast answer.
I will test it as you described.
In the meantime i went another way.
Attached you find a screenshot.
I integrated the microchip 32 Compiler as described on your Website, compiled it and burned it separately with the Pickit.
Voila, the LED is blinking, but approx. 5-6 Times slower then programmed.
I am new to the pics and i think this has to do with the configuration bits, so that the Compiler calculates with the wrong oscillator freq.

Is ist possible to configure this bits in your IDE, or somewhere else?

Firewing is fantastic, thank you for thifine Compiler!!

Dietmar
Attachments
Unbenannt - Kopie.GIF
Unbenannt - Kopie.GIF (12.08 KiB) Viewed 37358 times
Atmega8
 
Posts: 17
Joined: Mon Mar 17, 2014 3:31 pm

Re: UBW32 and Pickit 3 enough?

Postby David John Barker » Mon Mar 17, 2014 7:35 pm

> I integrated the microchip 32 Compiler as described on your Website

As mentioned earlier, you don't have to do that - Firewing will build for the 32MX795F512L. In addition, if you build using the native Firewing compiler the code will be optimised using -O2. If you build using the Microchip toolsuite, the code will not be optimised! Just change the toolsuite option from "Microchip 32" to "Firewing 32" in the IDE and re-build - that's all you need to do.

> compiled it and burned it separately with the Pickit

That's a good approach. Generate a *.hex file in the Firewing IDE and then burn using PicKit via MPLAB.

>Is ist possible to configure this bits in your IDE

Yes. Unfortunately the 32MX795F512L device file does not have the necessary definitions yet. For example, the default Firewing MCU is the 32MX150F128 which has a bunch of definitions like this:
Code: Select all
' Peripheral Module Disable Configuration
' ON - allow only one configuration
' OFF - Allow multiple configurations
public config PMDL1WAY(PMDL1WAY) = {ON, OFF}

' Peripheral Pin Select Configuration
' ON - allow only one configuration
' OFF - Allow multiple configurations
public config IOL1WAY(IOL1WAY) = {ON, OFF}

etc etc...

To set these values in the program, you would use
Code: Select all
config FSOSCEN = OFF
config IESO = OFF
config POSCMOD = OFF
config OSCIOFNC = OFF
config FUSBIDIO = OFF
config FVBUSONIO = OFF
config JTAGEN = OFF
config FWDTEN = OFF

etc etc..

I think adding these definition to the 32MX795F512L would be a little difficult and take some time (although it could be done). That said, you wouldn't need everything - just enough to get your code working. Most of the default would probably work. You might be lucky, it may be the settings for the 32MX795F512L may be similar or in some cases the same as the 32MX150F128 , in which case you could just copy and paste - but you would really need to check the datasheet first before doing that!

I made the device generator open source (http://www.firewing.info/pmwiki.php?n=FirewingUser.SystemGenerator) - maybe myself or someone else could add the automatic generation of fuse settings in the future.

In the meantime, you can change the fuse settings in MPLAB (which I assume you are suing to drive yout PicKit?)
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: UBW32 and Pickit 3 enough?

Postby Atmega8 » Mon Mar 17, 2014 8:03 pm

Thank you David,

i use the newer Mpbxlab.
It is not the better choice i think..

However it works.

In C or other languages there a compiler " options" to define the oscillator Speed.
I couldn't find it in firewing, so my LED is blinking with 1/5 of programmed speed.

Can you show me where and how i can set this "Options"?

THX,
Dietmar
Atmega8
 
Posts: 17
Joined: Mon Mar 17, 2014 3:31 pm

Re: UBW32 and Pickit 3 enough?

Postby David John Barker » Mon Mar 17, 2014 8:05 pm

I forgot to add, make sure you have

Clock = <value>

on the next line after

device = 32MX...

To match the clock speed of the target board, else the delay routines will not be correct.
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: UBW32 and Pickit 3 enough?

Postby Atmega8 » Mon Mar 17, 2014 8:48 pm

Clock = Value in MHZ ?
Atmega8
 
Posts: 17
Joined: Mon Mar 17, 2014 3:31 pm

Re: UBW32 and Pickit 3 enough?

Postby David John Barker » Mon Mar 17, 2014 9:38 pm

clock = 40 ' 40 MHz
clock = 80 ' 80 MHz

Etc...

See the online language reference for not information.
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: UBW32 and Pickit 3 enough?

Postby Atmega8 » Tue Mar 18, 2014 7:00 pm

Device = 32MX795F512L
clock = 8
config FSOSCEN = OFF



ERROR:
identifier not decalred FSOSCEN...
:(
Atmega8
 
Posts: 17
Joined: Mon Mar 17, 2014 3:31 pm

Re: UBW32 and Pickit 3 enough?

Postby Atmega8 » Tue Mar 18, 2014 7:08 pm

Ok,

must be declared in the include files of this pic...

That is to much, to sophisticated for me...

I'll have to wait until this is implemented...

Sorry Firewing;.)
Atmega8
 
Posts: 17
Joined: Mon Mar 17, 2014 3:31 pm

Next

Return to Development Environment

Who is online

Users browsing this forum: No registered users and 2 guests

cron

x