UBW32 and Pickit 3 enough?

Discuss the Firewing development environment

Re: UBW32 and Pickit 3 enough?

Postby funlw65 » Wed Mar 19, 2014 8:39 pm

Thank you David for the solution! Hopefully, @atmega8 will figure it out!
funlw65
 
Posts: 40
Joined: Thu Jan 16, 2014 2:32 pm

Re: UBW32 and Pickit 3 enough?

Postby Atmega8 » Wed Mar 19, 2014 10:30 pm

Thanks to all,

with this Settings the LED blinks 10-12 times to slow ;-(((
'*****************************************************************************
'* Name : UNTITLED.1 *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2014 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 15.03.2014 *
'* Version : 1.0 *
'* Notes : *
'* : *
'*****************************************************************************

' Imports section...

' Declarations...
Device = 32MX795F512L
clock = 80
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)


Sub Main()
TRISB.14 = 0 ' make pin output
TRISE.0 =0
while true
PORTB.14 = 1 ' switch on LED
PORTE.0 = 1
delayms(500) ' wait 0.5 seconds
PORTB.14 = 0 ' switch LED off
PORTE.0 =0
delayms(500) ' wait 0.5 seconds
end while


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

Re: UBW32 and Pickit 3 enough?

Postby funlw65 » Wed Mar 19, 2014 10:47 pm

:) that is because you have to change David's settings, with your hid bootloader settings (the ones I gave you)
funlw65
 
Posts: 40
Joined: Thu Jan 16, 2014 2:32 pm

Re: UBW32 and Pickit 3 enough?

Postby Jerry Messina » Wed Mar 19, 2014 10:51 pm

Maybe this??
Code: Select all
    public config FPLLODIV(FPLLODIV) = {DIV_1}
    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}       
    public config FNOSC(FNOSC) = {PRIPLL}
   
    ' set config for program...
    config FPLLODIV = DIV_1         // 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)
    config FNOSC    = PRIPLL        // Oscillator Selection   


I think that matches up to what funlw65 said the bootloader sets it to.
Jerry Messina
 
Posts: 280
Joined: Thu Feb 14, 2013 10:16 am

Re: UBW32 and Pickit 3 enough?

Postby Atmega8 » Wed Mar 19, 2014 10:53 pm

Hi,

i don't use a bootloader.
I compile The code with firewing and burn it with Pickit 3.
Atmega8
 
Posts: 17
Joined: Mon Mar 17, 2014 3:31 pm

Re: UBW32 and Pickit 3 enough?

Postby Jerry Messina » Wed Mar 19, 2014 10:56 pm

yeah, but if those settings get 80MHz for the bootloader, they should work ok without it, too.
Jerry Messina
 
Posts: 280
Joined: Thu Feb 14, 2013 10:16 am

Re: UBW32 and Pickit 3 enough?

Postby Atmega8 » Wed Mar 19, 2014 10:56 pm

@funlw65

Settings from which forum?;-), which post?
Who IS who what IS what....
Atmega8
 
Posts: 17
Joined: Mon Mar 17, 2014 3:31 pm

Re: UBW32 and Pickit 3 enough?

Postby Atmega8 » Wed Mar 19, 2014 11:27 pm

Please can Someone explain the Syntax for example of:

public config FPLLODIV(FPLLODIV) = {DIV_4}

and the corresponding

config FPLLODIV = DIV_4 // PLL Output Divider


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

Re: UBW32 and Pickit 3 enough?

Postby funlw65 » Wed Mar 19, 2014 11:40 pm

Just try what Jerry Messina gave you just now (is the same with what I gave you but adapted to Firewing).

But lets clarify some things. The PIC32 must "receive" a configuration from you, just like an ATmega8. When on ATmega you set a bootloader (or any program), that ATmega needs some configuration fuses in order to work. Then your programs don't need a configuration anymore.

If you use a bootloader for your PIC32, that configuration is already written (when you burned the bootloader first time) and you will erase/write just a part of your FLASH - the PIC32 will remain programmed with the old configuration, don't needs you to write it again. If you don't use a bootloader, every time you write a new program, you erase the flash entirely so you will need to write the configuration again, with every new program. The configuration will be always identical (doesn't matter what program you wrote inside, a bootloader or a simple program) because it is specific to your hardware that will not change (your crystal is soldered to the board, etc.).

Just try what Messina wrote.

Vasi

I think I just wrote the most abiguous explanation ever ...
Last edited by funlw65 on Sat Mar 22, 2014 2:32 pm, edited 1 time in total.
funlw65
 
Posts: 40
Joined: Thu Jan 16, 2014 2:32 pm

Re: UBW32 and Pickit 3 enough?

Postby Atmega8 » Sat Mar 22, 2014 12:42 pm

Hi,

"Just try what Jerry Messina gave you just now (is the same with what I gave you but adapted to Firewing)."

Thank you funlw65, it works and now with the correct frequenc!!


@ David
You told me to Change the Compiler from microchip32 to firewing32 for better code optimization.
But after doing this, the compiler throws an error.
Don't know what he is complaining about ;-)

I cannot copy and paste Errors from your IDE; very unconvenient;-(
Attachments
Unbenannt.GIF
Unbenannt.GIF (16.27 KiB) Viewed 34788 times
Atmega8
 
Posts: 17
Joined: Mon Mar 17, 2014 3:31 pm

PreviousNext

Return to Development Environment

Who is online

Users browsing this forum: No registered users and 5 guests

cron

x