Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help me convert C to ASM

Status
Not open for further replies.

PICMICRO

New Member
I have been trying to find boot_loader for my dsPIC33FJ32MC202.
After some search I found this nice boot-loader, with easy GUI.
The Problem Is, I need to manually set the Oscillator Configuration.
I checked dsPIC33FJ family reference and found out examples of initialization code. So, here is my initialization code, to setup HS oscillator at 20MHz and PLL to generate 80Mhz Fosc.
Code:
// Select Internal FRC at POR
_FOSCSEL(FNOSC_FRC);
// Enable Clock Switching and Configure POSC in XT mode
_FOSC(FCKSM_CSECMD & OSCIOFNC_OFF & POSCMD_XT);
main()
{
// Configure PLL prescaler, PLL postscaler, PLL divisor
PLLFBD=30; // M=32
CLKDIVbits.PLLPOST=0; // N2=2
CLKDIVbits.PLLPRE=0b00010; // N1=4
// Initiate Clock Switch to Primary Oscillator with PLL
(NOSC=0b011)
// Wait for Clock switch to occur
while (OSCCONbits.COSC != 0b011)
}
The problem is my Bootloader Firmware is in ASM, so I need to convert above code to ASM. Any help Please?
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top