Vitat's homepage

General => MP3 => Topic started by: Maddog_rvo on 28 Sep 2005, 08:59



Title: Emulator built , how to test / change firmware for 7.3728Mhz
Post by: Maddog_rvo 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?


Title: Re: Emulator built , how to test / change firmware for 7.3728Mhz
Post by: Maddog_rvo on 28 Sep 2005, 11:06
Hmm something is bothering me, isnt the reset pin supposed to be connected :?:
AtMega8 wont work without reset pin connected i think


Title: Re: Emulator built , how to test / change firmware for 7.3728Mhz
Post by: Maddog_rvo 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 :( 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 :(


Title: Re: Emulator built , how to test / change firmware for 7.3728Mhz
Post by: DdJ 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


Title: Re: Emulator built , how to test / change firmware for 7.3728Mhz
Post by: Maddog_rvo 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  :D

So that means the communication to the pc is working now :D
Can somebody convert the delays to work with a 7.3728 crystal (exactly half the speed of the one intended in the schematic)


Title: Re: Emulator built , how to test / change firmware for 7.3728Mhz
Post by: Vitat 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.


Title: Re: Emulator built , how to test / change firmware for 7.3728Mhz
Post by: Maddog_rvo on 29 Sep 2005, 01:31
Tried 5 different stores here in Holland, none of them had that crystal :( 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  :?


Title: Re: Emulator built , how to test / change firmware for 7.3728Mhz
Post by: Maddog_rvo 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


Title: Re: Emulator built , how to test / change firmware for 7.3728Mhz
Post by: andrethomas 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.



Title: Re: Emulator built , how to test / change firmware for 7.3728Mhz
Post by: Maddog_rvo 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;
   }


Title: Re: Emulator built , how to test / change firmware for 7.3728Mhz
Post by: andrethomas 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.


Title: Re: Emulator built , how to test / change firmware for 7.3728Mhz
Post by: Maddog_rvo 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


Title: Re: Emulator built , how to test / change firmware for 7.3728Mhz
Post by: andrethomas 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.


Title: Re: Emulator built , how to test / change firmware for 7.3728Mhz
Post by: Maddog_rvo 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 :(  :oops:


Title: Re: Emulator built , how to test / change firmware for 7.3728Mhz
Post by: andrethomas 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.


Title: Re: Emulator built , how to test / change firmware for 7.3728Mhz
Post by: Maddog_rvo on 07 Oct 2005, 01:22
Well, my emulator works perfectly now, thanks to andrethomas who provided me with some 14.7456 crystals


Title: Re: Emulator built , how to test / change firmware for 7.3728Mhz
Post by: andrethomas on 08 Oct 2005, 10:08
:)

What are you connecting the emulator to? You going to use a pc with winamp or did you get a yampp3 ?

I was originally going to put a small mini-itx motherboard into the car, but when I actually got around to it I had all kinds of logistical problems so I ended up ordering a kit for building the yampp3 - Waiting for it to arrive :)


Title: Re: Emulator built , how to test / change firmware for 7.3728Mhz
Post by: Maddog_rvo on 24 Oct 2005, 14:16
:)

What are you connecting the emulator to? You going to use a pc with winamp or did you get a yampp3 ?

I was originally going to put a small mini-itx motherboard into the car, but when I actually got around to it I had all kinds of logistical problems so I ended up ordering a kit for building the yampp3 - Waiting for it to arrive :)

I`m going to use it to connect to a laptop, have built a 4.5A 15V powersupply for it and some nice touch screen for Navigation Purposes