Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

Sort By

USER REQUESTS

first | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 last
Stephen Madeira
Nemweb

posted on 2011/09/26 03:28:28 PM CEST

Measurement

Basic ADC on Mikrobasic

Hi everyone, I'd like to receive and basic mikrobasic code, just to read the AN0 of PIC16F876A and set PWM1 in the scale.
Thanks.

Jesper van Beek
early_ash

posted on 2011/09/22 07:56:40 AM CEST

Communication > Ethernet

Send email wiht Pic18

Hello people,

Does anybody know how to send (small) emails from your pic18F87J60 (or with an ENC24J60). At this moment I only have the standard librarie which makes your PIC a webserver. But I want a program that sends an email every 'x' seconds.

Regards,

Chris Knight
chrisknight99

posted on 2011/09/19 12:51:44 PM CEST

Communication > CAN / LIN / RS485

Lin Bus

Hi Folks,

Are there any lin bus libaries out there?

Edward L
Berek8

posted on 2011/09/14 09:23:07 PM CEST

Audio & Speech

Audio recording with dsPIC & SD card!

Hello guys, anyone could give me a little help or ideas with this?

I'm at this moment using the dspic30F, with a sampling rate of 44.1 Khz, I would like to save the data of the ADC converter in the SD as a wav file (I already have the header btw), however I'm not really sure what should be the ideal way of doing it, maybe trying to save the data after X number of samples or after filling X number of sectors?

Thanks!!!!

marcel nijssen
marcel n

posted on 2011/09/09 05:51:04 PM CEST

Measurement

Why is this not working ccp capture mode

hi i have a program to measurement the period of my rc receiver , total period and , how long the hi puls stay high.

here my code : im use easypic 5 , cristal 4mhz , pic16f877a , microkbasic V5.01

i have also a another program but its works , and thats it , not safe thats why i thy this .

[code]

Program puls_meting_1

' Procedure for high-going pulse:
' 1. Configure CCP to capture on rising edge
' 2. Setup Timer1 so it will not overflow during max pulse width time
' 3. Enable ccp capture
' 4. Once capture flag bit is set, save captured value as T1
' 5. Reconfigure CCP to capture on falling edge
' 6. On 2nd capture, save 2nd value as PW
' 7. Subtract T1 from PW for the pulse width value

'DEFINE OSC 4

Symbol Capture = PIR1.2 ' CCP1 capture flag
Dim PULS1 as WORD ' totaal tijdt
Dim PULS2 as WORD ' totaal tijdt
Dim T1 as WORD ' 1st capture value
Dim PW as WORD ' 2nd capture value & ultimately final pulse width
Dim T1_HighByte as WORD ' 1st capture value
Dim T1_LowByte as WORD ' 1st capture value
Dim PW_HighByte as WORD ' 1st capture value
Dim PW_LowByte as WORD ' 1st capture value
Dim Text as string[10]
dim LCD_RS as sbit at RB4_bit
LCD_EN as sbit at RB5_bit
LCD_D4 as sbit at RB0_bit
LCD_D5 as sbit at RB1_bit
LCD_D6 as sbit at RB2_bit
LCD_D7 as sbit at RB3_bit

LCD_RS_Direction as sbit at TRISB4_bit
LCD_EN_Direction as sbit at TRISB5_bit
LCD_D4_Direction as sbit at TRISB0_bit
LCD_D5_Direction as sbit at TRISB1_bit
LCD_D6_Direction as sbit at TRISB2_bit
LCD_D7_Direction as sbit at TRISB3_bit

'===============================================================================
'-------- PROCEDURES --- PROCEDURES --- PROCEDURES --- declarations ------------
'===============================================================================
sub procedure Lcd_leeg

Lcd_Cmd(_LCD_CLEAR) ' Clear display
Lcd_Cmd(_LCD_CURSOR_OFF) ' Cursor off
end sub

main:



TRISC.2 = 1 ' CCP1 input pin (Capture input on 16f877a)
INTCON = 0 ' Interrupts off
CCP1CON = %00000101 ' Capture mode, capture on rising edge
T1CON = 0 ' TMR1 prescale=1, clock=Fosc/4, TMR1=off
TMR1H = 0 ' Clear high byte of TMR1 counter
TMR1L = 0 ' Clear low byte
T1CON.0 = 1 ' Turn TMR1 on here
Capture = 0 ' Clear capture int flag bit

While(1)

While Not Capture ' Wait here until capture on rising edge
Wend

' Rising edge detected / stuff 'captured' Timer1 value in T1
T1_HighByte = CCPR1H
T1_LowByte = CCPR1L
TMR1H = 0 ' Clear high byte of TMR1 counter
TMR1L = 0 ' Clear low byte

PULS2 = (T1_LowByte - T1_HighByte) ' High pulse width = PW-T1
CCP1CON.0 = 0 ' Configure capture for falling edge now
Capture = 0 ' Clear capture interrupt flag bit

While Not Capture ' Wait here until capture on falling edge
Wend

' Falling edge detected / stuff 'captured' Timer1 value in PW
PW_HighByte = CCPR1H
PW_LowByte = CCPR1L
TMR1H = 0 ' Clear high byte of TMR1 counter
TMR1L = 0 ' Clear low byte

PULS1 = (PW_LowByte - PW_HighByte)

Lcd_Init() ' Initialize Lcd

Lcd_leeg()
'Lcd_Out(1,1,"Puls MS")
'WordToStr (PULS,Text)
'Lcd_Out (1,8 ,Text)

Lcd_Out(1,1,"H/L")
WordToStr (PULS1,Text)
Lcd_Out (1,5 ,Text)
Lcd_Out(1,11,"-")
WordToStr (PULS2,Text)
Lcd_Out (1, 12,Text)

Lcd_Out(2,1,"H/L")
WordToStr (T1_HighByte,Text)
Lcd_Out (2,5 ,Text)
Lcd_Out(2,11,"-")
WordToStr (T1_LowByte,Text)
Lcd_Out (2, 12,Text)
Delay_ms(10)

Wend
END.
[/code]

thank you for your responce, marcel nijssen

first | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 last