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.

Basic to Assembly

Status
Not open for further replies.

Mr.K

New Member
program by 3vo for a dimmer can anyone convert this to asm for a PIC16F628a? I will rep(now that I know what the hell it is lol)
-Thanks Mr.K
Code:
// main program...
If PWM.SetFreq(5000) Then
Duty = 0
 While true
      PWM.SetDutyPercent(Duty)
      If ( (sw0 = 1) And (Duty < 10) ) Then     
      Inc(Duty)
      DelayMS(10)
      While sw0 = 1 Wend
      EndIf
      PWM.SetDutyPercent(Duty)
      If ( (sw1 = 1) And (Duty >0) ) Then     
      Dec(Duty)
      DelayMS(10)
      while sw1 = 1 wend 
      EndIf
      
   Wend
EndIf
 
Yes a compiler can do the conversion. There are several for the 18 series, BoostC ( demo version ) and GreatCow Basic are 2. You may need to do some conversion to make it compile.
 
I paid my ASM dues several times over. No thanks.

This is the thing. When I helped the author of the Swordfish Basic code he was trying to learn to write code.

What I see here is a person attempting to paste bits and scraps together without learning any language. If you want to do that sort of thing maybe you should be looking at an adrinuo(sp?).
 
Yes a compiler can do the conversion. There are several for the 18 series, BoostC ( demo version ) and GreatCow Basic are 2. You may need to do some conversion to make it compile.

are those just specifically for the 18 series in particular or can it be for the 16 series
 
Arduino.
If you're using ASM for some reason I would definitly recommend something like the Arduino, which is an AVR micro controller. They're MUCH easier to program in ASM that PIC's are.
 
Arduino.
If you're using ASM for some reason I would definitly recommend something like the Arduino, which is an AVR micro controller. They're MUCH easier to program in ASM that PIC's are.
Umm... You don't program an Arduino in assembler. You program it in a C-like language (interpreted? not sure).

You're probably thinking of a bare AVR chip. And they are maybe a bit easier to program in asm, but not too terribly much.
 
Last edited:
If he's having problem with basic code he's gonna choke on converting Nigels code to work with his particular model of PIC, worth a shot though.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top