Archive | USB RSS for this section

Power with USB2UART

Now its done and working 100% All power pins are good and on spot. Also TX, RX works great! (COM3) on my PC.

Power ARM/PIC with USB UART

Hey all im making a new PCB which i will use for ARM and PIC micros.
Features:
5v Supply Via USB (SMD)
3.3v Supply Via LM1117 3.3 (DPAK)
1.8v Supply Via LM1117 ADJ (SOT223)
USB to UART Via FT232RL IC (SOIC)

All powered by one 5v USB connection. Also the USB is 3v for ARM and PIC. The entire board is small too.

29.30mm x 33.62mm AKA 1.15in x 1.32in

Nice and small. It has a 8 pin port which is:
1. 5v
2. GND
3. 3.3v
4. GND
5. 1.8v
6. GND
7. TXD
8. RXD

All GNDs are tied together. Also has some caps of course to clean the supply and 2 leds for the USB 2 UART part. The LED Can be either SMD or Through Hole. I made my own eagle part to allow both on 1 pad.

Here are some pictures…

Microchip PIC USB Test

Playing around with Microchips USB Framework. Basically from here i got the schematic and info.

http://www.waitingforfriday.com/index.php/Building_a_PIC18F_USB_device

Here are some pictures of my test board and a video of it in action.

Just to also add i used the magazine paper to do this and it came out 99% perfect!!!

Digital Etch A Sketch

This is my single knob version of a etch a scketch. The PIC controlling the Rotary Encoder is a 18F4620 but smaller pics like 18F1320 can be used. and 16F pics also.

The windows program was developed in C#(C Sharp) and it connects to the PIC via USB to UART connection aka FT232RL IC.

Take a look at the video below:

FT232R RS232 to USB Converter

Finally decided to make a PCB for this. I had the IC since last year heh… Installs fine an i see the LED light up on Sending data from PC to it… not tested yet. Once tested ill post schematic and code used to test it…

Here is some code that seems to be working so far….

/* *****************************************************************************
;                                                                             *
;    Filename:                                                                   *
;    Date:                                                                       *
;    File Version: 001                                                        *
;                                                                             *
;    Author:   Jason Lopez                                                    *
;    Company:  AtomSoft                                                       *
;                                                                             *
;***************************************************************************** */

#include <p18f2525.h>
#include <delays.h>
#include <string.h>

#pragma config OSC = INTIO67,PWRT = OFF,BOREN = OFF,WDT = OFF,PBADEN = OFF

/************************************
Prototypes
*************************************/
void main(void);
void USART_Init(void);
void USART_vSendByte( unsigned char u8Data);
unsigned char USART_vReceiveByte(void);
void delayms( unsigned char t);

/************************************
Definitions and Variables
*************************************/
#define LEDON 0x11//switch led on command
#define LEDOFF 0x22//switch led off command

/************************************
Main
*************************************/
void main(void){
unsigned char x;
OSCCON = 0x72;                  //8MHz clock
while(!OSCCONbits.IOFS);        //wait for osc stable

USART_Init();

while(1){
for(x=0;x<10;x++){
USART_vSendByte(0x30+x);
delayms(100);
}
x = USART_vReceiveByte();
USART_vSendByte(x);
}
}

void USART_Init(void)
{
TRISCbits.TRISC7 = 1;    //SETUP UART
TXSTA = 0;
SPBRG = 103;     //1200bps

RCONbits.IPEN = 1;
IPR1bits.RCIP = 1; //PRIORITY

TXSTAbits.TXEN = 1;  //ENABLE TX
RCSTAbits.CREN = 1;  //ENABLE RX
RCSTAbits.SPEN = 1;  //ENABLE SERIAL PORT and PIN Config

PIR1   = 0b00000000;
PIE1   = 0b00101000;
IPR1   = 0b00101000;
}

void USART_vSendByte( unsigned char u8Data)
{
// Wait if a byte is being transmitted
while(!TXSTAbits.TRMT);
// Transmit data
TXREG = u8Data;
}
unsigned char USART_vReceiveByte(void)
{
// Wait until a byte has been received
while(!PIR1bits.RCIF);
// Return received data
return RCREG;
}
void delayms( unsigned char t)
{
unsigned char i;
for(i=0;i<t;i++)
Delay1KTCYx(2);
}