Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 11, 2016, 12:51:45 12:51


Login with username, password and session length


Pages: [1]
Print
Author Topic: (Still) Configuring oscillator problems...  (Read 892 times)
0 Members and 1 Guest are viewing this topic.
TucoRamirez
Senior Member
****
Offline Offline

Posts: 277

Thank You
-Given: 197
-Receive: 95


Tuco ... dead or Alive


« on: December 24, 2013, 10:21:09 10:21 »

hi, i was playing around with a pic24fj64G002, with both mikroC and XC16 but i very confused with the fuses, i reused the same logic as on f4550 to set up many of the options , then in code i reassigned functions to point to the right serial outs but i hav nothing at the output...


Im using a 12MHz xtal and my uart outs are RB7(tx) and RB8(rx)

does anybody have any experience on that pic24?

thanks
Logged

Whoever double crosses me and leaves me alive... he understands nothing about Tuco.
Gallymimu
Hero Member
*****
Offline Offline

Posts: 579

Thank You
-Given: 101
-Receive: 151


« Reply #1 on: December 24, 2013, 09:14:54 21:14 »

I've used these (or chips close enough in the 24F family).

some obvious things:
- set the TRIS bits properly for output (TX) and input (RX) normally the value of 0 in the tris is for output 1 is for input.
- does that chip have peripheral pin select?  That can be a little funny to set up the first time since inputs and outputs have different setting schemes.
- sometimes the config bits can select between a couple different sets of pins, that has gotten me into trouble before
- are you sure the code is running?  Oscillator problems can be a problem so be sure you can blink an LED or something so you know the code runs
- have you tried the RX input to see if that works?
- make sure any error registers in the UART are cleared, some serial ports won't transmit if there is an error flag set.
- double check your baud rate settings.  If you are way out of bounds on the baud rate a variety of funny behaviors can occur.

None of that probably helps but that's what I can think of.
Logged
TucoRamirez
Senior Member
****
Offline Offline

Posts: 277

Thank You
-Given: 197
-Receive: 95


Tuco ... dead or Alive


« Reply #2 on: December 24, 2013, 09:19:07 21:19 »

ok, if i found a led in my junkbox i'll test by blinky blinky little led ...  otherwise i think i have in my junkbox a TDS210 (funny face )  , i'll test and i'll put my results... btw  Merry XxxMAs
Logged

Whoever double crosses me and leaves me alive... he understands nothing about Tuco.
TucoRamirez
Senior Member
****
Offline Offline

Posts: 277

Thank You
-Given: 197
-Receive: 95


Tuco ... dead or Alive


« Reply #3 on: December 24, 2013, 11:10:21 23:10 »

oscilloscope says "tucos oscillator setup is ok"  (xt no pll stuff by now),  i tested uart output and is ok in the right pin at the right bitrate,
Code:
Crystal:12MHz external

CONFIG4   :$ABF8 : 0xFFDF
CONFIG3   :$ABFA : 0xFCFF
CONFIG2   :$ABFC : 0xA29E
CONFIG1   :$ABFE : 0x3F7F


and testcode....
Code:

void main() {

     LATB=0;
     PORTB=0;

  // Disable all ADC
  AD1PCFG = 0xFFFF;
  TRISA = 0x0000;

  // Make RB0, RB1, RB2 inputs for the ADC
  TRISB = 0b000000100000000;
  // Asign pin locations for tx/rx from the uart
  Unlock_IOLOCK();
  PPS_Mapping(7, _OUTPUT, _U1TX );
  PPS_Mapping(8, _INPUT, _U1RX);
  Lock_IOLOCK();


     UART1_Init(9600);//115200);    // Initialize UART module at 115200 bps
     Delay_ms(100);         // Wait for UART module to stabilize
     //1bit= 100us aprox ...
     //
while(1)
{
  //debug
  //UART1_Write_Text("Start");
  UART1_Write("Tuco");
  UART1_Write(13);
  UART1_Write(10);
  Delay_ms(100);
}

}



so the problem is coming from my F2MGLA02 bluetooth module, because it show rubbish and /or nothing at all...


I'll check after xmas with another module (unfortunately i forgot the soldering tools at the office Cry )
« Last Edit: December 24, 2013, 11:12:50 23:12 by TucoRamirez » Logged

Whoever double crosses me and leaves me alive... he understands nothing about Tuco.
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC