Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Pic 18f series controller I/O port

Status
Not open for further replies.

Ranbeer Singh

Full Member level 5
Joined
Jul 30, 2015
Messages
259
Helped
22
Reputation
44
Reaction score
22
Trophy points
1,298
Location
Faridabad India
Activity points
3,266
Hi
I want to know what is the minimun swithing time for pic 18F series controller general output pin?
I want to switch it for PWM.
 

Ignoring the rise and fall time (slew rate) of the output driver, the switching time can be no faster than one instruction time to make the pin high plus one instruction time to make it low. The instruction time depends on the clock frequency you are using.

Brian.
 
Maximum switching frequency will be Fosc/2, if you fullfill whole memory with BSC and BCR inctructions. Goto will require 2 tics.
But for 8 bit PWM calculation will be different. Fosc/(4 * 2 ^ 8), so for 16 MHz it will be about 16kHz. Fosc/4 is a timer time base. And 2 ^ 8 is a period value.
 
Thanks a lot

Is there is not harware specification except to slew rate!
Can I operate to output continue on/off... for a long time?
 

Is there is not harware specification except to slew rate!
No, because it depends on your software, the pins will not change by themselves!

The speed depends on the instructions you use to make the pin high or low and the program flow around them. The time taken for each instruction is explained in the data sheet but is itself a multiple of the clock period you are using. The clock rate depends on crystal or external source you are using and to some degree, the configuration register settings. With so many combinations to cater for it would be impossible to specify the speed. Typically the fastest possible is to use the maximum clock frequency then just to set and reset a port bit in adjacent instructions or to negate the port contents which can be done in two clock cycles but that excludes the use of any other instructions so it would be pointless.

I think all PIC18F processors have at least one built-in PWM generator which would be more appropriate to use than a general purpose I/O pin. The fatest rate still depends on the clock frequency but the PWM registers can be programmed to produce different PWM rates. The formulas are in the data s
Brian.
 
hello,

Can I operate to output continue on/off... for a long time?

Yes, you can .. but your MCU will not do other job.

Code:
// with  Fosc=48Mhz  => Fosc/4=12Mhz cycle=0.083µS
 // boucle en 3 cycles => 0,25µS  pour 1/2 periode
 // 0,5µS pour 1 periode => 2Mhz    on RA4 output
    while(1)
 {
    _asm{
 ici:
   BTG LATA,4,0       // 1 cycle 0.08µS
     bra ici          // 2 cycles 0.17µS
    }
 }

another test **broken link removed**
 
Actually I was making double PWM output with single timer, same pulse period & double on/off time.
These data are sufficient for me witch given by you.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top