<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comentários em: ALERTADOR FALANTE DE LANTERNAS LIGADAS &#8211; ADICIONANDO SONS A APLICAÇÕES COM PIC &#8211; C/ PIC 16F628A (REF205)	</title>
	<atom:link href="http://picsource.com.br/archives/7871/feed/" rel="self" type="application/rss+xml" />
	<link>http://picsource.com.br/archives/7871/</link>
	<description></description>
	<lastBuildDate>Sun, 11 Sep 2016 18:01:49 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.5</generator>
	<item>
		<title>
		Por: Claudio Larios		</title>
		<link>http://picsource.com.br/archives/7871/comment-page-1/#comment-4182</link>

		<dc:creator><![CDATA[Claudio Larios]]></dc:creator>
		<pubDate>Fri, 01 Jan 2016 23:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.larios.tecnologia.ws/iBlog/?p=7871#comment-4182</guid>

					<description><![CDATA[Em resposta a &lt;a href=&quot;http://picsource.com.br/archives/7871/comment-page-1/#comment-4181&quot;&gt;CICERO&lt;/a&gt;.

Olá Cicero!
Uma necessidade para funcionar o código apresentado é que exista no pic escolhido dois módulos internos: 
1) O módulo CCP (para gerar o PWM correspondente ao som reproduzido).
2) O módulo SSP (para comunicação em alta velocidade com o SD Card, usando o protocolo SPI).
O PIC 16f628a tem módulo CCP mas não tem módulo SSP. O código já não funcionará simplesmente migrando.

Cláudio]]></description>
			<content:encoded><![CDATA[<p>Em resposta a <a href="http://picsource.com.br/archives/7871/comment-page-1/#comment-4181">CICERO</a>.</p>
<p>Olá Cicero!<br />
Uma necessidade para funcionar o código apresentado é que exista no pic escolhido dois módulos internos:<br />
1) O módulo CCP (para gerar o PWM correspondente ao som reproduzido).<br />
2) O módulo SSP (para comunicação em alta velocidade com o SD Card, usando o protocolo SPI).<br />
O PIC 16f628a tem módulo CCP mas não tem módulo SSP. O código já não funcionará simplesmente migrando.</p>
<p>Cláudio</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		Por: CICERO		</title>
		<link>http://picsource.com.br/archives/7871/comment-page-1/#comment-4181</link>

		<dc:creator><![CDATA[CICERO]]></dc:creator>
		<pubDate>Fri, 01 Jan 2016 14:27:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.larios.tecnologia.ws/iBlog/?p=7871#comment-4181</guid>

					<description><![CDATA[Ola Claudio, se vc poderia mudar esse codigo fone ai do site pra um PIC 16F628A Por exemplo,]]></description>
			<content:encoded><![CDATA[<p>Ola Claudio, se vc poderia mudar esse codigo fone ai do site pra um PIC 16F628A Por exemplo,</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		Por: Ata		</title>
		<link>http://picsource.com.br/archives/7871/comment-page-1/#comment-4180</link>

		<dc:creator><![CDATA[Ata]]></dc:creator>
		<pubDate>Fri, 01 Jan 2016 12:49:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.larios.tecnologia.ws/iBlog/?p=7871#comment-4180</guid>

					<description><![CDATA[Claudio Larios----Felicitari si LA Multi Ani !!!]]></description>
			<content:encoded><![CDATA[<p>Claudio Larios&#8212;-Felicitari si LA Multi Ani !!!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		Por: Claudio Larios		</title>
		<link>http://picsource.com.br/archives/7871/comment-page-1/#comment-4179</link>

		<dc:creator><![CDATA[Claudio Larios]]></dc:creator>
		<pubDate>Fri, 01 Jan 2016 09:24:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.larios.tecnologia.ws/iBlog/?p=7871#comment-4179</guid>

					<description><![CDATA[Em resposta a &lt;a href=&quot;http://picsource.com.br/archives/7871/comment-page-1/#comment-4177&quot;&gt;CICERO&lt;/a&gt;.

Olá Cícero! 
Muito obrigado por seu comentário. Vendo o link do colega Moty notei que ele já fornece o que você deseja. Tem versão para 16f877 e 16f690 .Estes não são já fáceis de encontrar?  Quais seriam os picos mais fáceis e acessíveis na sua opinião? 

Cláudio]]></description>
			<content:encoded><![CDATA[<p>Em resposta a <a href="http://picsource.com.br/archives/7871/comment-page-1/#comment-4177">CICERO</a>.</p>
<p>Olá Cícero!<br />
Muito obrigado por seu comentário. Vendo o link do colega Moty notei que ele já fornece o que você deseja. Tem versão para 16f877 e 16f690 .Estes não são já fáceis de encontrar?  Quais seriam os picos mais fáceis e acessíveis na sua opinião? </p>
<p>Cláudio</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		Por: CICERO		</title>
		<link>http://picsource.com.br/archives/7871/comment-page-1/#comment-4178</link>

		<dc:creator><![CDATA[CICERO]]></dc:creator>
		<pubDate>Fri, 01 Jan 2016 00:45:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.larios.tecnologia.ws/iBlog/?p=7871#comment-4178</guid>

					<description><![CDATA[// Sound Recorder using SD card and PIC16F876A, by www.moty22.co.uk
//
// File will compile with the free Hi-Tech C compiler.
// Recording is done by the ADC using only the LSB. Bytes are written to the SD
// at the rate of 20KHz. It is similar to the format of .wav sound files.  
// For playback CCP is used as a DAC (Digital to Analogue Converter).
   
#include 

__CONFIG(LVPDIS &#038; WDTDIS &#038; UNPROTECT &#038; HS);

#define CS RC0		//chip select input
#define Stop RB0	//stop pushbutton
#define Play RB1	//play PB
#define Rec RB2		//record PB
#define Pause RB3	//pause PB
#define RecLED RB5
#define errorLED RB4

unsigned long loc;	//pause location

unsigned char SPI(unsigned char data)		// send character over SPI
{
	SSPBUF = data;			// load character
	while (!BF);		// sent
	return SSPBUF;		// received character
}

char Command(unsigned char frame1, unsigned long adrs, unsigned char frame2 )
{	
	unsigned char i, res;
	SPI(0xFF);
	SPI((frame1 &#124; 0x40) &#038; 0x7F);	//first 2 bits are 01
	SPI((adrs &#038; 0xFF000000) &#062;&#062; 24);		//first of the 4 bytes address
	SPI((adrs &#038; 0x00FF0000) &#062;&#062; 16);
	SPI((adrs &#038; 0x0000FF00) &#062;&#062; 8);
	SPI(adrs &#038; 0x000000FF);	
	SPI(frame2 &#124; 1);				//CRC and last bit 1

	for(i=0;i&#060;10;i++)	// wait for received character
	{
		res = SPI(0xFF);
		if(res != 0xFF)break;
	}
	return res;	  
}

void InitSD(void)
{
	unsigned char i;
	
	for(i=0; i &#060; 10; i++)SPI(0xFF);		// min 74 clocks
	CS=0;			// Enabled for SPI mode

	if (Command(0x00,0,0x95) !=1) errorLED = 1;	// Reset SD command

	while (Command(0x01,0,0xFF) !=0) {} //wait for idle state
	
	SSPM1 = 0;	// full speed 2MHz
	CS = 1;
}

void WriteSD(void)	
{
	unsigned int r,i;
	CS = 0;	
	ADON = 1;
	RecLED = 1;
	
	r = Command(25,loc,0xFF);	//multi sector write
	if(r != 0)
	{
		errorLED = 1;
		ADON = 0;
		RecLED = 0;
	}
	SPI(0xFF);
	SPI(0xFF);
	SPI(0xFF);
	
	while(Stop &#038;&#038; Pause)
	{
		SPI(0xFC);	//multi sector token byte
		for(i=0;i&#062; 1);
		}
 		SPI(0xFF);	// CRC
		SPI(0xFF);	// CRC
	
	if((r=SPI(0xFF) &#038; 0x0F) == 0x05){	//data accepted	= 0101		
		for(i=10000;i&#062;0;i--){				
			if(r=SPI(0xFF))	break;
		}	
	}
	else{
		errorLED = 1;
	}
	while(SPI(0xFF) != 0xFF);	// while busy
	loc += 512; 		
	}
	SPI(0xFD);	//stop transfer	token byte
			
	SPI(0xFF);
	SPI(0xFF);
	while(SPI(0xFF) != 0xFF);	// while busy
	
	CS = 1;
	ADON = 0;
	RecLED = 0;
}

void ReadSD(void)
{
	unsigned int i,r;
	unsigned char data;
	CS = 0;
	r = Command(18,loc,0xFF);	//read multi-sector
	if(r != 0)errorLED = 1;			//if command failed

	while(Stop &#038;&#038; Pause)
	{
		while(SPI(0xFF) != 0xFE);	// wait for first byte
		for(i=0;i&#062; 1);
			TMR2IF = 0;
		}
		SPI(0xFF);	//discard of CRC
		SPI(0xFF);
		loc += 512;	
	}
	
	Command(12,0x00,0xFF);	//stop transmit
	SPI(0xFF);
	SPI(0xFF);
	CS = 1;
}

void main(void)
{
//	unsigned char Pause = 0;
//	unsigned int i;
	loc = 512;
	
	// PIC I/O init
	TRISC = 0b10010000;		// sck rc3, sdo rc5, sdi rc4, CS rc0, rc2 CPP1.
	TRISB = 0b1111;   	// switches
	RBPU = 0;		//pullup on
	RecLED = 0;
	errorLED = 0;
		
	//analogue init
	CCP1CON = 0B1100;	//PWM mode
	PR2 = 100;	//20KHz
	T2CON = 0B100;	//prescale 1, post scale 1, timer2 on
	ADCON1 = 0B11001110;		// Fosc/16, ch1, ref=Vdd, right just. 
	ADCON0 = 0B1000000;	// Fosc/16.
	
	//SPI init
	SSPCON = 0B110010;	//low speed osc/64(125kHz),enabled,clock idle=H
	CS = 1; 		// disable SD	

	InitSD();
	
	while(1) {
	if(!Rec) WriteSD();	
	if(!Play) ReadSD();
	if(!Stop) loc = 512;

	}		
}]]></description>
			<content:encoded><![CDATA[<p>// Sound Recorder using SD card and PIC16F876A, by <a href="http://www.moty22.co.uk" rel="nofollow ugc">http://www.moty22.co.uk</a><br />
//<br />
// File will compile with the free Hi-Tech C compiler.<br />
// Recording is done by the ADC using only the LSB. Bytes are written to the SD<br />
// at the rate of 20KHz. It is similar to the format of .wav sound files.<br />
// For playback CCP is used as a DAC (Digital to Analogue Converter).</p>
<p>#include </p>
<p>__CONFIG(LVPDIS &amp; WDTDIS &amp; UNPROTECT &amp; HS);</p>
<p>#define CS RC0		//chip select input<br />
#define Stop RB0	//stop pushbutton<br />
#define Play RB1	//play PB<br />
#define Rec RB2		//record PB<br />
#define Pause RB3	//pause PB<br />
#define RecLED RB5<br />
#define errorLED RB4</p>
<p>unsigned long loc;	//pause location</p>
<p>unsigned char SPI(unsigned char data)		// send character over SPI<br />
{<br />
	SSPBUF = data;			// load character<br />
	while (!BF);		// sent<br />
	return SSPBUF;		// received character<br />
}</p>
<p>char Command(unsigned char frame1, unsigned long adrs, unsigned char frame2 )<br />
{<br />
	unsigned char i, res;<br />
	SPI(0xFF);<br />
	SPI((frame1 | 0x40) &amp; 0x7F);	//first 2 bits are 01<br />
	SPI((adrs &amp; 0xFF000000) &gt;&gt; 24);		//first of the 4 bytes address<br />
	SPI((adrs &amp; 0x00FF0000) &gt;&gt; 16);<br />
	SPI((adrs &amp; 0x0000FF00) &gt;&gt; 8);<br />
	SPI(adrs &amp; 0x000000FF);<br />
	SPI(frame2 | 1);				//CRC and last bit 1</p>
<p>	for(i=0;i&lt;10;i++)	// wait for received character<br />
	{<br />
		res = SPI(0xFF);<br />
		if(res != 0xFF)break;<br />
	}<br />
	return res;<br />
}</p>
<p>void InitSD(void)<br />
{<br />
	unsigned char i;</p>
<p>	for(i=0; i &lt; 10; i++)SPI(0xFF);		// min 74 clocks<br />
	CS=0;			// Enabled for SPI mode</p>
<p>	if (Command(0x00,0,0&#215;95) !=1) errorLED = 1;	// Reset SD command</p>
<p>	while (Command(0x01,0,0xFF) !=0) {} //wait for idle state</p>
<p>	SSPM1 = 0;	// full speed 2MHz<br />
	CS = 1;<br />
}</p>
<p>void WriteSD(void)<br />
{<br />
	unsigned int r,i;<br />
	CS = 0;<br />
	ADON = 1;<br />
	RecLED = 1;</p>
<p>	r = Command(25,loc,0xFF);	//multi sector write<br />
	if(r != 0)<br />
	{<br />
		errorLED = 1;<br />
		ADON = 0;<br />
		RecLED = 0;<br />
	}<br />
	SPI(0xFF);<br />
	SPI(0xFF);<br />
	SPI(0xFF);</p>
<p>	while(Stop &amp;&amp; Pause)<br />
	{<br />
		SPI(0xFC);	//multi sector token byte<br />
		for(i=0;i&gt; 1);<br />
		}<br />
 		SPI(0xFF);	// CRC<br />
		SPI(0xFF);	// CRC</p>
<p>	if((r=SPI(0xFF) &amp; 0x0F) == 0x05){	//data accepted	= 0101<br />
		for(i=10000;i&gt;0;i&#8211;){<br />
			if(r=SPI(0xFF))	break;<br />
		}<br />
	}<br />
	else{<br />
		errorLED = 1;<br />
	}<br />
	while(SPI(0xFF) != 0xFF);	// while busy<br />
	loc += 512;<br />
	}<br />
	SPI(0xFD);	//stop transfer	token byte</p>
<p>	SPI(0xFF);<br />
	SPI(0xFF);<br />
	while(SPI(0xFF) != 0xFF);	// while busy</p>
<p>	CS = 1;<br />
	ADON = 0;<br />
	RecLED = 0;<br />
}</p>
<p>void ReadSD(void)<br />
{<br />
	unsigned int i,r;<br />
	unsigned char data;<br />
	CS = 0;<br />
	r = Command(18,loc,0xFF);	//read multi-sector<br />
	if(r != 0)errorLED = 1;			//if command failed</p>
<p>	while(Stop &amp;&amp; Pause)<br />
	{<br />
		while(SPI(0xFF) != 0xFE);	// wait for first byte<br />
		for(i=0;i&gt; 1);<br />
			TMR2IF = 0;<br />
		}<br />
		SPI(0xFF);	//discard of CRC<br />
		SPI(0xFF);<br />
		loc += 512;<br />
	}</p>
<p>	Command(12,0&#215;00,0xFF);	//stop transmit<br />
	SPI(0xFF);<br />
	SPI(0xFF);<br />
	CS = 1;<br />
}</p>
<p>void main(void)<br />
{<br />
//	unsigned char Pause = 0;<br />
//	unsigned int i;<br />
	loc = 512;</p>
<p>	// PIC I/O init<br />
	TRISC = 0b10010000;		// sck rc3, sdo rc5, sdi rc4, CS rc0, rc2 CPP1.<br />
	TRISB = 0b1111;   	// switches<br />
	RBPU = 0;		//pullup on<br />
	RecLED = 0;<br />
	errorLED = 0;</p>
<p>	//analogue init<br />
	CCP1CON = 0B1100;	//PWM mode<br />
	PR2 = 100;	//20KHz<br />
	T2CON = 0B100;	//prescale 1, post scale 1, timer2 on<br />
	ADCON1 = 0B11001110;		// Fosc/16, ch1, ref=Vdd, right just.<br />
	ADCON0 = 0B1000000;	// Fosc/16.</p>
<p>	//SPI init<br />
	SSPCON = 0B110010;	//low speed osc/64(125kHz),enabled,clock idle=H<br />
	CS = 1; 		// disable SD	</p>
<p>	InitSD();</p>
<p>	while(1) {<br />
	if(!Rec) WriteSD();<br />
	if(!Play) ReadSD();<br />
	if(!Stop) loc = 512;</p>
<p>	}<br />
}</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		Por: CICERO		</title>
		<link>http://picsource.com.br/archives/7871/comment-page-1/#comment-4177</link>

		<dc:creator><![CDATA[CICERO]]></dc:creator>
		<pubDate>Fri, 01 Jan 2016 00:42:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.larios.tecnologia.ws/iBlog/?p=7871#comment-4177</guid>

					<description><![CDATA[Ola Claudio Primeiramente Feliz ano Novo pra vc e toda sua Família, Claudio venho acompanhando seus Projetos são todos bons até hoje vc só faz Projetos bons, Parabéns mesmo, queria lhe perguntar porque vc não faz algo com um Micro SD Card, seria muito útil,,,
Quero que vc veja este Link Claudio, sobre Um Gravador digital com Micro SD Card e um PIC, Se possível faz um projeto desse  com PICS Mais facial e acessível  de encontrar...
 http://320volt.com/pic16f876a-sandisk-sd-kart-ses-kayit-calma/]]></description>
			<content:encoded><![CDATA[<p>Ola Claudio Primeiramente Feliz ano Novo pra vc e toda sua Família, Claudio venho acompanhando seus Projetos são todos bons até hoje vc só faz Projetos bons, Parabéns mesmo, queria lhe perguntar porque vc não faz algo com um Micro SD Card, seria muito útil,,,<br />
Quero que vc veja este Link Claudio, sobre Um Gravador digital com Micro SD Card e um PIC, Se possível faz um projeto desse  com PICS Mais facial e acessível  de encontrar&#8230;<br />
 <a href="http://320volt.com/pic16f876a-sandisk-sd-kart-ses-kayit-calma/" rel="nofollow ugc">http://320volt.com/pic16f876a-sandisk-sd-kart-ses-kayit-calma/</a></p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
