Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 20, 2024, 03:02:32 03:02


Login with username, password and session length


Pages: [1]
Print
Author Topic: Hello , problen wich pic 30f6012  (Read 3136 times)
0 Members and 1 Guest are viewing this topic.
centiane
Newbie
*
Offline Offline

Posts: 18

Thank You
-Given: 5
-Receive: 6


« on: March 10, 2008, 10:51:33 22:51 »

Hello , my problen is i am not activate two ouput in this micro, the first port is not activate and the secon port yes is activate.

#define bit ledrojo salida.0
#define bit ledverde salida.1



ledrojo=1
ledverde=1
while(1)


Example of code.

Thank.

Posted on: March 10, 2008, 10:28:12 22:28 - Automerged

The problen is solutined.

The problen is a error in datasheet of microchip

TRISB 02C6 TRISB15 TRISB14 TRISB13 TRISB12 TRISB11 TRISB10 TRISB9 TRISB8 TRISB7 TRISB6 TRISB5 TRISB4 TRISB3 TRISB2 TRISB1 TRISB0 1111 1111 1111 1111
PORTB 02C8 RB15 RB14 RB13 RB12 RB11 RB10 RB9 RB8 RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0 0000 0000 0000 0000
LATB 02CB LATB15 LATB14 LATB13 LATB12 LATB11 LATB10 LATB9 LATB8 LATB7 LATB6 LATB5 LATB4 LATB3 LATB2 LATB1 LATB0 0000 0000 0000 0000
Note: Refer to “dsPIC30F Family Reference Manual” (DS70046) for descriptions of register bit fields.

The register for LATB not is a 02CB , is a 02CA, this problen is a error in the datasheet.

Thank.

Centiane.
Logged
eemkutay
Active Member
***
Offline Offline

Posts: 149

Thank You
-Given: 21
-Receive: 220


Knowledge is Power


« Reply #1 on: March 11, 2008, 08:02:04 08:02 »

Hi,

Your definations're wrong. (you shouldnt use "bit" keyword)

/*
For example  (for microchip C30)
PORTB0 = red_led
PORTB1 = green_led
*/

#define  red_led       LATBbits.LATB0
#define  green_led    LATBbits.LATB1


red_led=1;
green_led=0;
// delay (any way you like)
red_led=0;
green_led=1;






Logged
centiane
Newbie
*
Offline Offline

Posts: 18

Thank You
-Given: 5
-Receive: 6


« Reply #2 on: March 11, 2008, 11:31:03 11:31 »

Ok the problen is solution.

*/

#define  red_led       0x02CB.0                                  ; The register for lab not is a 0x02CB ia a 0x02CA error of datasheet
#define  green_led    0x02CB.1                                  ; The register for lab not is a 0x02CB ia a 0x02CA

ledrojo=1;
ledverde=1;


**********************************************************
This is a solution.

#define  red_led       0x02CA.0                                 
#define  green_led    0x02CA.1                                 

ledrojo=1;
ledverde=1;



Thank very much.
« Last Edit: March 11, 2008, 11:36:32 11:36 by centiane » Logged
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