UBW32 and Pickit 3 enough?

Discuss the Firewing development environment

Re: UBW32 and Pickit 3 enough?

Postby David John Barker » Tue Mar 18, 2014 7:24 pm

or configure in MPLAB...
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 8:17 pm

tried it via MPLAB Integration..

The language-tool suite "Firewing BASIC Compiler" does not appear to have a linker.
Atmega8
 
Posts: 17
Joined: Mon Mar 17, 2014 3:31 pm

Re: UBW32 and Pickit 3 enough?

Postby David John Barker » Tue Mar 18, 2014 8:20 pm

What application are you using to control you PicKIT?
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 8:24 pm

ehhmm,

i use the MPLAB IDE.
Under Programmer i select Pickit 3 which seems to work.
It recognizes the pickit and i can set the power supply.
I must say that in parallel MPLABX is installed, maybe this is a Problem ?

Error Window:

Clean: Deleting intermediary and output files.
Clean: Done.
The language-tool suite "Firewing BASIC Compiler" does not appear to have a linker.
BUILD FAILED: Tue Mar 18 21:18:58 2014



THX
Attachments
mplab.GIF
mplab.GIF (128.65 KiB) Viewed 34391 times
Atmega8
 
Posts: 17
Joined: Mon Mar 17, 2014 3:31 pm

Re: UBW32 and Pickit 3 enough?

Postby David John Barker » Tue Mar 18, 2014 8:36 pm

> i use the MPLAB IDE

So do what you did before, just use MPLAB to program the device. Don't use it to build your program. Load your *.hex file and then from the menu select CONFIGURE...CONFIGURATION BITS. Uncheck "configuration bits set in code" and then change to the values you want. Then program the MCU. Firewing works with the chipKIT Max32, which is based on the PIC32MX795F512L processor - so it sounds like all you need to do is set the config bits correctly.
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 8:54 pm

OK,

i changed the way you adviced.
I can Programm with the hex file.

My Problem now is to set the correct config bits.
The ubw32 has a 8 MHZ external Quartz.
clock = 8
The LED flashes slower than it should.

What config bits to set??

Of course this is not a Firewing Problem.
But can you help also in this issue?

Thamk you for your fast Responses, seem you are always "online".
In wich Timezone do you live?

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

Re: UBW32 and Pickit 3 enough?

Postby David John Barker » Tue Mar 18, 2014 9:31 pm

> My Problem now is to set the correct config bits.
> The ubw32 has a 8 MHZ external Quartz.

It's most likely being clocked at 80MHz, so the fuses will reflect that (external 8MHz PLL'ed to 80). Make sure the top of your program has the following:
Code: Select all
device = 32MX795F512L
clock = 80

If not, add it and rebuild your program. Then try the attached (untested) config settings and let me know how it goes...

> In wich Timezone do you live?

Based in the UK...
Attachments
fuse-settings.jpg
fuse-settings.jpg (138.53 KiB) Viewed 34385 times
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: UBW32 and Pickit 3 enough?

Postby funlw65 » Wed Mar 19, 2014 12:54 am

Guys, according to UBW32 USB HID Bootloader, these are the config bits

Code: Select all
    #pragma config FPLLODIV = DIV_1         // PLL Output Divider
    #pragma config UPLLEN   = ON                 // USB PLL Enabled
    #pragma config UPLLIDIV = DIV_2         // USB PLL Input Divider
    #pragma config FPLLMUL  = MUL_20        // PLL Multiplier
    #pragma config FPLLIDIV = DIV_2         // PLL Input Divider
    #pragma config FWDTEN   = OFF           // Watchdog Timer
    #pragma config FPBDIV   = DIV_1         // Peripheral Clock divisor
    #pragma config WDTPS    = PS1           // Watchdog Timer Postscale
    #pragma config FCKSM    = CSECME        // Clock Switching & Fail Safe Clock Monitor enabled
    #pragma config OSCIOFNC = OFF           // CLKO Enable
    #pragma config POSCMOD  = XT            // Primary Oscillator
    #pragma config IESO     = ON               // Internal/External Switch-over
    #pragma config FSOSCEN  = OFF           // Secondary Oscillator Enable (KLO was off)
    #pragma config FNOSC    = PRIPLL        // Oscillator Selection
    #pragma config CP       = OFF           // Code Protect
    #pragma config BWP      = OFF           // Boot Flash Write Protect
    #pragma config PWP      = OFF           // Program Flash Write Protect
    #pragma config ICESEL   = ICS_PGx2      // ICE/ICD Comm Channel Select
    #pragma config DEBUG    = OFF            // Background Debugger Enable


So, atmega8 should look here and change there accordingly.
funlw65
 
Posts: 40
Joined: Thu Jan 16, 2014 2:32 pm

Re: UBW32 and Pickit 3 enough?

Postby funlw65 » Wed Mar 19, 2014 1:01 am

David, those config bits are not configured, but in the device include file we can see DEVCFG0, DEVCFG1, DEVCFG2, DEVCFG3 ... how your BASIC parser will consider these? We can't use them with "config" keyword...

I tried to advice atmega8 to do something like this but is useless if your parser will do nothing about it:

Code: Select all
Device = 32MX795F512L
Clock = 80

sub main()
   DEVCFG0 = &H7FFFFFFF ' these are equivalents of your cfg.bits
   DEVCFG1 = &HFF600DDB
   DEVCFG2 = &HFFF879D9
   DEVCFG3 = &HFFFFFFFF
   TRISB.14 = 0       ' make pin output
   while true
      PORTB.14 = 1    ' switch on LED
      delayms(500)    ' wait 0.5 seconds
      PORTB.14 = 0    ' switch LED off
      delayms(500)    ' wait 0.5 seconds
   end while
end sub
funlw65
 
Posts: 40
Joined: Thu Jan 16, 2014 2:32 pm

Re: UBW32 and Pickit 3 enough?

Postby David John Barker » Wed Mar 19, 2014 7:22 pm

If you are using the Microchip XC32 toolsuite, the following should work OK...

Code: Select all
public config FPLLODIV(FPLLODIV) = {DIV_4}
public config UPLLEN(UPLLEN) = {ON}         
public config UPLLIDIV(UPLLIDIV) = {DIV_2}       
public config FPLLMUL(FPLLMUL) = {MUL_20}       
public config FPLLIDIV(FPLLIDIV) = {DIV_2}       
public config FWDTEN(FWDTEN) = {ON, OFF}         
public config FPBDIV(FPBDIV) = {DIV_1}         
public config WDTPS(WDTPS) = {PS1}         
public config FCKSM(FCKSM) = {CSECME}       
public config OSCIOFNC(OSCIOFNC) = {OFF}         
public config POSCMOD(POSCMOD) = {XT}         
public config IESO(IESO) = {ON}               
public config FSOSCEN(FSOSCEN) = {OFF}       

' set config for program...
config FPLLODIV = DIV_4         // PLL Output Divider
config UPLLEN   = ON            // USB PLL Enabled
config UPLLIDIV = DIV_2         // USB PLL Input Divider
config FPLLMUL  = MUL_20        // PLL Multiplier
config FPLLIDIV = DIV_2         // PLL Input Divider
config FWDTEN   = OFF           // Watchdog Timer
config FPBDIV   = DIV_1         // Peripheral Clock divisor
config WDTPS    = PS1           // Watchdog Timer Postscale
config FCKSM    = CSECME        // Clock Switching & Fail Safe Clock Monitor enabled
config OSCIOFNC = OFF           // CLKO Enable
config POSCMOD  = XT            // Primary Oscillator
config IESO     = ON            // Internal/External Switch-over
config FSOSCEN  = OFF           // Secondary Oscillator Enable (KLO was off)
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

PreviousNext

Return to Development Environment

Who is online

Users browsing this forum: No registered users and 2 guests

cron

x