Vitat's homepage
28 Apr 2024, 23:18 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: 21.03.08 Произведено обновление сайта/Site was updated
 
  Home   Forum   Help Search Login Register  

Pages: [1] 2   Go Down
  Print  
Author Topic: Emulator built , how to test / change firmware for 7.3728Mhz  (Read 17884 times)
0 Members and 1 Guest are viewing this topic.
Maddog_rvo
Junior
**
Gender: Male
Posts: 14


View Profile Email
« on: 28 Sep 2005, 08:59 »

I changed the Value in Constants.h and de prescaler in link.c and changed every value that is compared to T into (value * 4) , if i connect the interface to my computer and start up hyperterminal i dont see any communication, did i do something wrong? Do i need special settings in hyperterminal? or which baudrate do i have to use?
Logged
Maddog_rvo
Junior
**
Gender: Male
Posts: 14


View Profile Email
« Reply #1 on: 28 Sep 2005, 11:06 »

Hmm something is bothering me, isnt the reset pin supposed to be connected Question
AtMega8 wont work without reset pin connected i think
Logged
Maddog_rvo
Junior
**
Gender: Male
Posts: 14


View Profile Email
« Reply #2 on: 28 Sep 2005, 23:26 »

Well i connected a 10K from pin1 (reset) to VCC and still dont have any communication between my pc and device, connecting to HU doesnt do anything either Sad can someone help convert the code to 7.3728 Mhz??

/edit

I think your schematic is wrong in a 2nd place, TX from pc needs to be connected to pin13 of MAX232, and not pin14
RX from pc needs to be connected to pin14 of MAX232 instead of pin13

if i do that and put a 10k resistor between VCC and Reset of the AVR then i get a whole bunch of messages like these :
#0A#20#43#44#20#45#72#72#6F#72#0D
they come very fast.

BUT i still dont get any communication with my HU Sad
« Last Edit: 28 Sep 2005, 23:30 by Maddog_rvo » Logged
DdJ
Junior
**
Posts: 14


View Profile
« Reply #3 on: 28 Sep 2005, 23:37 »

I think your schematic is wrong in a 2nd place, TX from pc needs to be connected to pin13 of MAX232, and not pin14
RX from pc needs to be connected to pin14 of MAX232 instead of pin13

It a MAX202 instead of a MAX232
Logged
Maddog_rvo
Junior
**
Gender: Male
Posts: 14


View Profile Email
« Reply #4 on: 28 Sep 2005, 23:41 »

It a MAX202 instead of a MAX232

Hehe found out that they`re pin compatible, couldnt get a MAX202 near here so i went for this one, have update now too, those codes i put here earlier
#0A#20#43#44#20#45#72#72#6F#72#0D they are CD error messages  Very Happy

So that means the communication to the pc is working now Very Happy
Can somebody convert the delays to work with a 7.3728 crystal (exactly half the speed of the one intended in the schematic)
Logged
Vitat
Administrator
Full Member
*****
Gender: Male
Posts: 338


11507314
View Profile
« Reply #5 on: 29 Sep 2005, 01:09 »

Put a correct crystal will be more easy...
What's a problem with needed crystal?
I can buy a programmable crystal in Russia and set any frequency in a shop.
Logged
Maddog_rvo
Junior
**
Gender: Male
Posts: 14


View Profile Email
« Reply #6 on: 29 Sep 2005, 01:31 »

Tried 5 different stores here in Holland, none of them had that crystal Sad only half of the speed so i took that one figuring that it would be relatively easy to convert the code for it..... Not easy for me though  Confused
Logged
Maddog_rvo
Junior
**
Gender: Male
Posts: 14


View Profile Email
« Reply #7 on: 29 Sep 2005, 19:12 »

I`m getting a litlte further now, i dont get CD ERROR`s anymore, now the emulator gives:
START
CD 01 10
<<<<<<

and the < keep commin, but the HU doesnt see the emulator, do i need to do something before it sees it?


//edit
when i connect voltage meter between ground and BUSM / BUSP i get 0,8V / 2,7V without HU connected, with HU connected both give around 1.5V is that correct?
when i measure the pins on the HU i get 2.5V on both pins
« Last Edit: 29 Sep 2005, 19:50 by Maddog_rvo » Logged
andrethomas
Junior
**
Posts: 20


View Profile
« Reply #8 on: 29 Sep 2005, 20:26 »

Hi

Did you get it working with a 7.3728? I was thinking of using a 8Mhz since I have a few mega8L's TQFP32 which may be useful if I can run the emulator at 8Mhz.

If you didnt get it working pm me your snail address and I'll pop two crystals in the mail for you.

Logged
Maddog_rvo
Junior
**
Gender: Male
Posts: 14


View Profile Email
« Reply #9 on: 29 Sep 2005, 20:43 »

Wont 8Mhz will be too difficult to adapt timings, 7.3728 Mhz is exactly half the speed so u can divide delays by 2. And even that is difficult to do, my emulator talks to pc now, even detects the HU but the HU wont see the emulator. I`m doing a little debugging and found out it crashes in this part :

u08 read_message(void)
{
#ifdef UART_TX_ASYNC
   cbi(UCSRB, UDRIE);               // disable UDR Empty Interrupt
#endif
   cbi(TIMSK, TOIE1);               // disable timer1 interrupt
   u08 i, Id[3], T = 0, Parity_Message;
   timer0_source(CK8);               //was CK64
   timer0_start();
   while (INPUT_IS_SET)
   {
      T = inp(TCNT0);
      if (T >= 200)                                                             //was 50
      {
         PRINT("timer200exit");                               
         goto err_exit;         // 200us max wait time
      }
   }
   if (T<100)                                                                                 // was 25
   {
      PRINT("timer<100exit");                                             // <------ Crashed here every cycle
      goto err_exit;
   }
Logged
andrethomas
Junior
**
Posts: 20


View Profile
« Reply #10 on: 29 Sep 2005, 20:47 »

heh - i'll probably just overclock the mega8l to 14mhz - its not serious, just wanted to make a smaller board for the one that's going into the car.
Logged
Maddog_rvo
Junior
**
Gender: Male
Posts: 14


View Profile Email
« Reply #11 on: 30 Sep 2005, 01:28 »

Well got it working a little bit, can receive commands from the HU (with 16Mhz Crystal) sending works too but only a little, by some luck i managed to set track title, do not know how though, i tried to get the Emulator for winamp to work, but that one doesnt do anything, not even serial comms to pc
Logged
andrethomas
Junior
**
Posts: 20


View Profile
« Reply #12 on: 30 Sep 2005, 20:01 »

I also tried the winamp emulator version and coudlnt get the firmware to work on the atmega8, *however* the standard firmware supports most of the functions used by winamp so it will actually work mostly anyway.
Logged
Maddog_rvo
Junior
**
Gender: Male
Posts: 14


View Profile Email
« Reply #13 on: 30 Sep 2005, 20:09 »

I also tried the winamp emulator version and coudlnt get the firmware to work on the atmega8, *however* the standard firmware supports most of the functions used by winamp so it will actually work mostly anyway.

Ahh? then my emulator doesnt work after all Sad  Embarassed
Logged
andrethomas
Junior
**
Posts: 20


View Profile
« Reply #14 on: 01 Oct 2005, 08:23 »

The firmware of brokly has some extended features. The original source from the main page will also work with most of the basic functionality. Some basic issues are surrounding the updating of the cdtext. You may also try the firmware I attach to this message.

Also, very important - You need to use one of the earlier version of winavr since the code doesnt compile properly with the newer versions. I use avr-gcc version 3.4.1 (WinAVR-20040720-install) for the purpose of compiling the firmware sources.

Note about attached firmware - I found it somewhere on some or the other website - Cant remember where.

The reason I am referring you to the more basic sources is so that you can more easily do your conversion to run on lower crystal frequency - The original code is a lot less complex.

* ipbus4+mod.rar (122.71 KB - downloaded 556 times.)
Logged
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

TinyPortal v1.0.5 beta 1© Bloc

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!